← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:charm-assets-tweak-negotiation into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:charm-assets-tweak-negotiation into launchpad:master.

Commit message:
charm: Tweak +apidoc content negotiation

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/445263

This arranges that requests from web browsers that don't specify any particular preferred content type get the HTML form, which seems a little friendlier.  `lazr.restfulclient` sends a specific `Accept` header, so should be unaffected by this.

(See https://httpd.apache.org/docs/current/mod/mod_mime.html#addtype for the syntax used here.)
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charm-assets-tweak-negotiation into launchpad:master.
diff --git a/charm/launchpad-assets/templates/vhost.conf.j2 b/charm/launchpad-assets/templates/vhost.conf.j2
index 28e62f2..320e7cc 100644
--- a/charm/launchpad-assets/templates/vhost.conf.j2
+++ b/charm/launchpad-assets/templates/vhost.conf.j2
@@ -7,9 +7,9 @@
     <Location "/+apidoc/">
         Options MultiViews
         DirectoryIndex index
-        AddType application/vnd.sun.wadl+xml .wadl
-        AddType application/vd.sun.wadl+xml .brokenwadl
-        AddType application/json .json
+        AddType application/vnd.sun.wadl+xml;qs=0.9 .wadl
+        AddType application/vd.sun.wadl+xml;qs=0.8 .brokenwadl
+        AddType application/json;qs=0.9 .json
         Header set Cache-Control "public,max-age=5184000"
         Require all granted
     </Location>