<blockquote>
<p>So have you completely ignored the rails processing and done your own from scratch?</p>
</blockquote>
<p>I wouldn't call it doing it all from scratch. I'm reusing the same MIME parsing logic the framework also uses and set a default format in case of XML, JSON or <code>*/*</code> for selected methods only.</p>
<blockquote>
<p>Can you explain more about the JOSM issue? Does it only affect old versions or does it still affect the current version? Has it been reported?</p>
</blockquote>
<p>Sure. What they are currently sending is the following:</p>
<pre><code>text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
</code></pre>
<p>There are a number of issues here:</p>
<ul>
<li><code>*</code> is not a valid mime type, the spec requires <code><MIME_type>/<MIME_subtype></code></li>
<li>The additional space after the semicolon is not permitted</li>
<li>The number format in q=.2 is invalid, is should be q=0.2</li>
</ul>
<p>I haven't reported those yet. Given that old versions will linger around for a longish time, we'd need to deal with this in any case.</p>
<blockquote>
<p>but avoiding them is not a good reason to use a suboptimal solution to something</p>
</blockquote>
<p>I think this would only affect the initial part of the set_default_request_format method, where neither an Accept header, not an url suffix were set (as in the case of unit tests only).</p>
<pre><code> accept_header = request.headers["HTTP_ACCEPT"]
if accept_header.nil?
# e.g. unit tests don't set an Accept: header by default, force XML in this case
request.format = "xml"
return
end
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications&email_token=AAK2OLOD6NGKX7PVANGSNPDRFDOMDA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH65LY#issuecomment-592441007">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMEQN2RNNFMJEVC5C3RFDOMDANCNFSM4KAKS5KA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLLG4DOQF63JKMVG4J3RFDOMDA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH65LY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications\u0026email_token=AAK2OLOD6NGKX7PVANGSNPDRFDOMDA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH65LY#issuecomment-592441007",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications\u0026email_token=AAK2OLOD6NGKX7PVANGSNPDRFDOMDA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENH65LY#issuecomment-592441007",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>