Koozali.org: home of the SME Server

Serving up .js as text/plain?

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Serving up .js as text/plain?
« on: September 29, 2015, 05:56:36 PM »
I'm running into an odd issue with ownCloud 8.1.3 on SME 9.0--the login button doesn't work when I use Chrome.  It works just fine using Firefox and Safari.  The ownCloud bugtracker includes https://github.com/owncloud/core/issues/18326, which indicates that the problem results from the web server assigning a non-executable MIME type to Javascript files.  When I take a look at the developer tools in Chrome, this appears to be confirmed--I'm seeing a number of errors along the lines of "Refused to execute script from * because its MIME type ( 'text/plain' ) is not executable, and strict MIME type checking is enabled."  The "from" location for all of these is local to my server, not from a remote host.

Sure enough, the default /etc/mime.types doesn't contain an entry for .js files, or anything about javascript at all.  It's also templated for some reason, even though it appears to be completely static.  The bug from ownCloud suggests using Apache's default mime.types file from http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types, so I downloaded that and replaced mime.types with it (I also put it into templates-custom).  It does specify .js files as application/javascript.  I then restarted apache (/etc/init.d/httpd-e-smith restart) and tried to load the page again, with the same result.

I'm a little lost on where to go from here.  Suggestions?
......

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: Serving up .js as text/plain?
« Reply #1 on: September 29, 2015, 06:28:46 PM »
You can try to add

AddType application/javascript .js

In your /etc/httpd/conf/httpd.conf, then restart apache and see if it makes a difference. In any case, you should open a bug so we can fixe this (either in the contrib, or in the core)
C'est la fin du monde !!! :lol:

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Serving up .js as text/plain?
« Reply #2 on: September 29, 2015, 07:08:26 PM »
I may have jumped the gun--after clearing my browser's cache, those errors go away, and the Login button works.  Sounds like it'd be a bug against e-smith-base, since that's where the template comes from.

http://bugs.contribs.org/show_bug.cgi?id=9078
« Last Edit: September 29, 2015, 07:13:40 PM by DanB35 »
......