ejabberd - Comments for "Serving crossdomain.xml with mod_http_fileserver" https://www.ejabberd.im/node/3982 en That was it, thanks badlop! https://www.ejabberd.im/node/3982#comment-55513 <p>That was it, thanks badlop!</p> Mon, 05 Apr 2010 19:03:12 +0000 aaronwinborn comment 55513 at https://www.ejabberd.im Old ejabberd version, probably doesn't implement the options https://www.ejabberd.im/node/3982#comment-55512 <div class="quote-msg"> <div class="quote-author"><em>aaronwinborn</em> wrote:</div> <p>This is ejabberd v. 2.0.0 by the way.</p></div> <p>Maybe the module you are running doesn't yet implement those options. Check the ejabberd Guide included in that exact version.</p> <p>I see that the ticket <noindex><a href="https://support.process-one.net/browse/EJAB-975" rel="nofollow" >Allow content types to be configured in ejabberd.cfg</a></noindex> was implemented in ejabberd 2.1.0</p> Mon, 05 Apr 2010 18:12:29 +0000 mfoss comment 55512 at https://www.ejabberd.im As a test, I just recompiled https://www.ejabberd.im/node/3982#comment-55511 <p>As a test, I just recompiled mod_http_fileserver from ejabberd_modules (the 2.0.x version) and swapped that with the version at /usr/lib/ejabberd/ebin/mod_http_fileserver.beam, with no effect on behavior. Frustrating.</p> Mon, 05 Apr 2010 17:14:16 +0000 aaronwinborn comment 55511 at https://www.ejabberd.im Negative tests work as https://www.ejabberd.im/node/3982#comment-55510 <p>Negative tests work as expected, serving a 404 when disabled.</p> <p>Oddly, if I comment out the mod_http_fileserver from modules, but leave the listening port, I now get<br /> <div class="codeblock"><code>HTTP/0.9 200 OK</code></div> </p><p> for them all, regardless of whether a file exists, but 0 bytes of course.</p> Mon, 05 Apr 2010 16:35:28 +0000 aaronwinborn comment 55510 at https://www.ejabberd.im All settings ignored... https://www.ejabberd.im/node/3982#comment-55509 <p>Apparently, any settings I have for content_type has no effect.</p> <p>Here are the tests I've run:</p> <p>I put "test.html", "test.png" and "test.blah" files in addition to the crossdomain.xml file in /home/my-user/web (not using /var/www since that's apache's home, even though apache's not installed).</p> <div class="codeblock"><code>{5280, ejabberd_http, [<br />&nbsp;&nbsp;&nbsp;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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]}</code></div> <p>and</p> <div class="codeblock"><code>&nbsp; {mod_http_fileserver, [{docroot, &quot;/home/xomba/web&quot;},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {content_types, [{&quot;.xml&quot;, &quot;text/xml&quot;}, {&quot;.png&quot;, &quot;experimental/blah&quot;}, {&quot;.blah&quot;, &quot;nothing/here&quot;}]},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {default_content_type, &quot;text/xml&quot;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]},</code></div> <p>Headers for each:</p> <p>crossdomain.xml (Expected text/xml)</p> <div class="codeblock"><code>HTTP/1.1 200 OK <p>Content-Type: application/octet-stream</p> <p>Content-Length: 323</p> <p>Server: ejabberd</p> <p>Last-Modified: Fri, 02 Apr 2010 20:44:19 GMT</p></code></div> <p>test.html (Expected either application/octet-stream or text/xml depending on whether default_content_type caught it)</p> <div class="codeblock"><code>HTTP/1.1 200 OK <p>Content-Type: text/html</p> <p>Content-Length: 8</p> <p>Server: ejabberd</p> <p>Last-Modified: Mon, 05 Apr 2010 16:13:09 GMT</p></code></div> <p>test.png (expected experimental/blah)</p> <div class="codeblock"><code>HTTP/1.1 200 OK <p>Content-Type: image/png</p> <p>Content-Length: 12453</p> <p>Server: ejabberd</p> <p>Last-Modified: Mon, 05 Apr 2010 16:15:31 GMT</p></code></div> <p>test.blah (expected nothing/here)</p> <div class="codeblock"><code>HTTP/1.1 200 OK <p>Content-Type: application/octet-stream</p> <p>Content-Length: 11</p> <p>Server: ejabberd</p> <p>Last-Modified: Mon, 05 Apr 2010 16:23:54 GMT</p></code></div> Mon, 05 Apr 2010 16:29:23 +0000 aaronwinborn comment 55509 at https://www.ejabberd.im This is ejabberd v. 2.0.0 by https://www.ejabberd.im/node/3982#comment-55508 <p>This is ejabberd v. 2.0.0 by the way.</p> Mon, 05 Apr 2010 16:07:37 +0000 aaronwinborn comment 55508 at https://www.ejabberd.im default_content_type https://www.ejabberd.im/node/3982#comment-55507 <p>I've also tried to set default_content_type. Still coming up as application/octet-stream...</p> <div class="codeblock"><code>&nbsp; {mod_http_fileserver, [{docroot, &quot;/var/www&quot;},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {content_types, [{&quot;.xml&quot;, &quot;text/xml&quot;}]},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {default_content_type, &quot;text/xml&quot;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]},</code></div> Mon, 05 Apr 2010 16:03:27 +0000 aaronwinborn comment 55507 at https://www.ejabberd.im Regardless of the https://www.ejabberd.im/node/3982#comment-55505 <p>Regardless of the content_types setting, I'm getting the following. That's after modifying the cfg file and restarting ejabberd of course.</p> <div class="codeblock"><code>http://xmpp.example.com:5280/crossdomain.xml <p>HTTP/1.1 200 OK</p> <p>Content-Type: application/octet-stream</p> <p>Content-Length: 323</p> <p>Server: ejabberd</p> <p>Last-Modified: Fri, 02 Apr 2010 20:44:19 GMT</p></code></div> Mon, 05 Apr 2010 15:37:06 +0000 aaronwinborn comment 55505 at https://www.ejabberd.im aaronwinborn wrote:   {5280, https://www.ejabberd.im/node/3982#comment-55503 <div class="quote-msg"> <div class="quote-author"><em>aaronwinborn</em> wrote:</div> <div class="codeblock"><code>&nbsp; {5280, ejabberd_http, [<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; web_admin,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {request_handlers,&nbsp;&nbsp;&nbsp;&nbsp; [{[&quot;xmpp-httpbind&quot;],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mod_http_bind},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {[], mod_http_fileserver}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]}</code></div> <p>this configuration also disabled the web_admin functionality.</p></div> <p>Right, I see that problem too. A solution is to indicate explicitely the webadmin, see as example:</p> <pre> {5280, ejabberd_http, [ {request_handlers, [ {["xmpp-httpbind"], mod_http_bind}, {["admin"], ejabberd_web_admin}, {[], mod_http_fileserver} ]} ]}, </pre> Sat, 03 Apr 2010 17:54:09 +0000 mfoss comment 55503 at https://www.ejabberd.im The option works for me https://www.ejabberd.im/node/3982#comment-55502 <p>If I configure the module without the content_type option, I get:</p> <pre>$ lynx <noindex><a href="http://localhost:5280/crossdomain.xml" title="http://localhost:5280/crossdomain.xml" rel="nofollow" >http://localhost:5280/crossdomain.xml</a></noindex> -mime_header HTTP/1.0 200 OK Connection: close Content-Length: 221 Server: ejabberd Last-Modified: Sat, 03 Apr 2010 17:40:43 GMT Content-Type: application/octet-stream ... </pre><p> If I configure some rare type:</p> <pre> {mod_http_fileserver, [ {docroot, "/tmp"}, {content_types, [{".xml", "texXxt/xm123l"}]} ]}, </pre><p>I get it as configured:</p> <pre> $ lynx <noindex><a href="http://localhost:5280/crossdomain.xml" title="http://localhost:5280/crossdomain.xml" rel="nofollow" >http://localhost:5280/crossdomain.xml</a></noindex> -mime_header HTTP/1.0 200 OK Connection: close Content-Length: 221 Server: ejabberd Last-Modified: Sat, 03 Apr 2010 17:40:43 GMT Content-Type: texXxt/xm123l ... </pre> Sat, 03 Apr 2010 17:48:48 +0000 mfoss comment 55502 at https://www.ejabberd.im