<p><b>@mmd-osm</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2485#discussion_r369710862">app/controllers/api_controller.rb</a>:</p>
<pre style='color:#555'>> +        if mime.symbol == :xml
+          request.format = "xml"
+          break
+        end
+
+        if mime.symbol == :json
+          request.format = "json"
+          break
+        end
+
+        # Any format, not explicitly requesting XML or JSON -> assume XML as default
+        if mime == "*/*"
+          request.format = "xml"
+          break
+        end
+      end
</pre>
<p>In both cases the response was generated by cgimap, so yes, Rails port and cgimap behaved differently for many years here.</p>
<p>In general, Accept header support in Rails is quite a delicate topic. There's a number of issues out there, like adding <code>*/*</code> would break multi format output, or as in your example, requesting text/plain would happily return XML.</p>
<p>It was the main reason for another round of Accept header parsing in <em>set_default_request_format</em>, rather than relying on the framework to do the right thing.</p>

<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=AAK2OLLCPZV726FHITLV7LDQ7CBUPA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCSVYB4I#discussion_r369710862">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJX5OVMG72KUXBHP53Q7CBUPANCNFSM4KAKS5KA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLIJ6566A6OAFMUPD2DQ7CBUPA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCSVYB4I.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=AAK2OLLCPZV726FHITLV7LDQ7CBUPA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCSVYB4I#discussion_r369710862",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2485?email_source=notifications\u0026email_token=AAK2OLLCPZV726FHITLV7LDQ7CBUPA5CNFSM4KAKS5KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCSVYB4I#discussion_r369710862",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>