Skip to content

rest protocol detection: test Accept header first; use startswith for Content-Type match

Christophe de Vienne requested to merge bitbucket/merged-pr-8 into branch/default

Created originally on Bitbucket by cmcdaniel (Craig McDaniel)

Was already merged in Bitbucket before import, marked as merged by the import user

  1. Some json requests will have 'Accept' = 'application/json', but won't set the Content-Type, which may leave it at default 'text/plain'.
  2. The 'Content-Type' may be something like 'application/json; charset=utf-8', so use startswith rather than an exact match.

Merge request reports