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?


Hello Ali,
Please kindly note that this forum is meant for general discussion of the App Engine platform, not specific technical issues. If you believe that what you've encountered is platform specific issue you can report this by creating an issue in the Issue Tracker and Google Cloud Support team member will assist you to resolve your issue. If your issue is not a platform issue but rather a problem with how you've configured your code, although you're not sure what it may be specifically, you should post to StackOverflow and community of developers will assist you.
In addition, I have noticed your project_id in this Google Group thread. I would advise you to take caution before sharing any personal project specific information like these in any public forums as they can be used to harm your application.