Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 494683

Summary: Content-Type header for js file mentions json
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, Silenio_Quarti
Version: 10.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2016-05-26 14:33:20 EDT
While debugging a different problem, I recorded the use of a quickfix in a JavaScript file and noticed that the Content-Type header references json and not js:

   Accept-Encoding:gzip, deflate, br
   Accept-Language:en-US,en;q=0.8
   Cache-Control:no-cache
   Connection:keep-alive
   Content-Length:4792
   Content-Type:application/json;charset=UTF-8

I would expect Content-Type to be:

   Content-Type:application/javascript;charset=UTF-8
Comment 1 Silenio Quarti CLA 2016-05-26 15:40:51 EDT
Is this in the request header or the response header?
Comment 2 Michael Rennie CLA 2016-05-27 14:17:25 EDT
(In reply to Silenio Quarti from comment #1)
> Is this in the request header or the response header?

The request header. the response header correctly mentions 'application/javascript'
Comment 3 Silenio Quarti CLA 2016-05-27 15:21:51 EDT
Which request?  The request Content-Type header is for the data the client is sending to the server (not the response type).
Comment 4 Michael Rennie CLA 2016-05-27 15:45:30 EDT
I applied a quick fix, monitored the network traffic and this is the request that is sent:

Request URL:<snip>
Request Method:POST
Status Code:412 Precondition Failed
Remote Address:23.79.204.28:443
Response Headers
    Cache-Control:max-age=604800
    Connection:close
    Content-Language:en-US
    Content-Length:0
    Content-Type:application/x-javascript; charset=UTF-8
    Date:Thu, 26 May 2016 14:32:37 GMT
    Expires:Thu, 02 Jun 2016 14:32:37 GMT
    Server:nginx/1.9.15
    Servertime:2
    X-Archived-Client-IP:169.45.162.106
    X-Backside-Transport:FAIL FAIL,FAIL FAIL
    X-Frame-Options:SAMEORIGIN
    X-Global-Transaction-Id:3076603101
    X-Powered-By:Servlet/3.0
    X-Time_Check:Proxy Time: 96 msec
Request Headers
    Accept:*/*
    Accept-Encoding:gzip, deflate, br
    Accept-Language:en-US,en;q=0.8
    Cache-Control:no-cache
    Connection:keep-alive
    Content-Length:4792
    Content-Type:application/json;charset=UTF-8
    Cookie:<snip>
    Host:<snip>
    If-Match:9d03da8b3f528b0af67f49fa996ad41b43c4ac40
    Origin:<snip>
    Orion-Version:1
    Pragma:no-cache
    Referer:<snip>
    User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2748.0 Safari/537.36
    X-HTTP-Method-Override:PATCH
    X-Requested-With:XMLHttpRequest
Comment 5 Silenio Quarti CLA 2016-05-27 16:12:25 EDT
This is POST with a json object as content, so the request content-type is correct.