Ticket #1088 (closed defect: fixed)
content-type autonegotiation is wonky
| Reported by: | wwaites | Owned by: | |
|---|---|---|---|
| Priority: | awaiting triage | Milestone: | ckan-v1.4 |
| Component: | ckan | Keywords: | |
| Cc: | Repository: | ckan | |
| Theme: | none |
Description
in ckan/controllers/package.py around line 130 it does some strange things...
perhaps replace with https://github.com/wwaites/autoneg
and handle redirection of these content types:
application/rdf+xml application/turtle text/plain text/x-graphviz
Change History
Note: See
TracTickets for help on using
tickets.

you use the negotiate function in autoneg.py with a cfg dictionary like this,
cfg = { "mime_types": [ ("application/xhtml+xml", ["html"]), ("text/html", ["html"], ("application/rdf+xml", ["rdf", "owl"]), ("application/turtle", ["ttl"]), ("text/plain", ["nt"]), ("text/x-graphviz", ["dot"]), ] for content_type, exts in negotiate(cfg, accept_header): if "html" in exts: render page normally else: redirect to semantic.ckan.net }