Ali Koc
2018-12-06 11:49:09 UTC
I have a simple java application running on Google App Engine Standard
environment, which along with servlets, also contains static html, css and
js files.
It seems js files are always served with "content-type: text/plain". Even
when I create a new Hello App Engine application (doing this in Eclipse
through GCP plugin) and add a simple js file to the project and deploy. The
js file is served as content-type: text/plain.
Note that when I debug locally, the files is served as
application/javascript as expected. The issue only occurs on the deployed
version.
Here is the link to the file in the hello world application:
https://test2-dot-baruch-221323.appspot.com/test.js
This is using Java 8. Here is what web.xml file look like:
<?xml version="1.0" encoding="utf-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<mime-mapping>
<extension>js</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping></web-app>
What am I missing here? Other static files such as html and css come with
correct content type, js seems to be the only one with issue. Can you give
me some pointers on how to debug this?
environment, which along with servlets, also contains static html, css and
js files.
It seems js files are always served with "content-type: text/plain". Even
when I create a new Hello App Engine application (doing this in Eclipse
through GCP plugin) and add a simple js file to the project and deploy. The
js file is served as content-type: text/plain.
Note that when I debug locally, the files is served as
application/javascript as expected. The issue only occurs on the deployed
version.
Here is the link to the file in the hello world application:
https://test2-dot-baruch-221323.appspot.com/test.js
This is using Java 8. Here is what web.xml file look like:
<?xml version="1.0" encoding="utf-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<mime-mapping>
<extension>js</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping></web-app>
What am I missing here? Other static files such as html and css come with
correct content type, js seems to be the only one with issue. Can you give
me some pointers on how to debug this?
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/bda7a435-c5fa-4c46-bd1c-51851264b9f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/bda7a435-c5fa-4c46-bd1c-51851264b9f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.