<?xml version="1.0" encoding="UTF-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><id>https://blog.pgxn.org/tags/html/</id><title>HTML</title><updated>2011-04-21T16:56:43Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/html/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/html/"/><author><name>The PGXN Maintainers</name></author><generator uri="https://gohugo.io/" version="0.167.0">Hugo</generator><entry><id>https://blog.pgxn.org/post/4809393274</id><title type="html">What Media Types for Browsing?</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2011/safe-media-types/"/><updated>2026-10-07T16:13:48Z</updated><published>2011-04-21T16:56:43Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="mime" label="MIME"/><category scheme="https://blog.pgxn.org/tags" term="media-type" label="Media Type"/><category scheme="https://blog.pgxn.org/tags" term="mime-type" label="MIME Type"/><category scheme="https://blog.pgxn.org/tags" term="browse" label="Browse"/><category scheme="https://blog.pgxn.org/tags" term="source" label="Source"/><category scheme="https://blog.pgxn.org/tags" term="user-submitted" label="User Submitted"/><category scheme="https://blog.pgxn.org/tags" term="content" label="Content"/><category scheme="https://blog.pgxn.org/tags" term="text" label="Text"/><category scheme="https://blog.pgxn.org/tags" term="plain-text" label="Plain Text"/><category scheme="https://blog.pgxn.org/tags" term="html" label="HTML"/><category scheme="https://blog.pgxn.org/tags" term="c" label="C"/><category scheme="https://blog.pgxn.org/tags" term="json" label="JSON"/><summary type="html"><![CDATA[<p>Thanks to a comment from &ldquo;Anon,&rdquo; I&rsquo;m auditing the media types used to serve
files from the &ldquo;Browse&rdquo; links on the site. The browse interface is managed by
<a href="https://search.cpan.org/perldoc?Plack::App::Directory">Plack::App::Directory</a>, which gets its media type mapping from <a href="https://github.com/miyagawa/Plack/blob/master/lib/Plack/MIME.pm">this file</a>.
What PGXN::API does is simply change the mappings of some of those types to
<code>text/plain</code>. As of <a href="https://github.com/pgxn/pgxn-api/commit/0157c18cbc0835b627fa2e42b2433337f5f3fff5">this commit</a>, files are served as plain text if:</p>
<ul>
<li>The strings &ldquo;html&rdquo;, &ldquo;x-c&rdquo;, &ldquo;xml&rdquo;, &ldquo;calendar&rdquo;, or &ldquo;vcard&rdquo; appear in the
default media type; or</li>
<li>The file name extension is one of <code>.bat</code>, <code>.css</code>, <code>.eml</code>, <code>.js</code>, <code>.json</code>,
<code>.mime</code>, or <code>.swf</code>.</li>
</ul>
<p>Are there other <a href="https://github.com/miyagawa/Plack/blob/master/lib/Plack/MIME.pm">media types</a> that should be disabled for safe
browsing of user-submitted content?</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Thanks to a comment from &ldquo;Anon,&rdquo; I&rsquo;m auditing the media types used to serve
files from the &ldquo;Browse&rdquo; links on the site. The browse interface is managed by
<a href="https://search.cpan.org/perldoc?Plack::App::Directory">Plack::App::Directory</a>, which gets its media type mapping from <a href="https://github.com/miyagawa/Plack/blob/master/lib/Plack/MIME.pm">this file</a>.
What PGXN::API does is simply change the mappings of some of those types to
<code>text/plain</code>. As of <a href="https://github.com/pgxn/pgxn-api/commit/0157c18cbc0835b627fa2e42b2433337f5f3fff5">this commit</a>, files are served as plain text if:</p>
<ul>
<li>The strings &ldquo;html&rdquo;, &ldquo;x-c&rdquo;, &ldquo;xml&rdquo;, &ldquo;calendar&rdquo;, or &ldquo;vcard&rdquo; appear in the
default media type; or</li>
<li>The file name extension is one of <code>.bat</code>, <code>.css</code>, <code>.eml</code>, <code>.js</code>, <code>.json</code>,
<code>.mime</code>, or <code>.swf</code>.</li>
</ul>
<p>Are there other <a href="https://github.com/miyagawa/Plack/blob/master/lib/Plack/MIME.pm">media types</a> that should be disabled for safe
browsing of user-submitted content?</p>
]]></content></entry></feed>