wrong content-type for assembly response

Archived from the Transloadit support forum. Originally posted on March 20, 2014; details may be outdated, see our docs for current behavior. Original thread

I’m using the jquery plugin, and during the course of processing, it hits remote transloadit URLs and returns executable javascript.
Hitting this URL:
http://mahnoor-status.transloadit.com/assemblies/REDACTED?seq=0&callback=_jqjsp&_1395326921211=
works.
BUT, it returns the content-type text/plain, which causes Chrome to (correctly) throw a warning. It seems like the response type should be application/javascript. Is there a way to fix this on my end? It’s making for an awfully noisy console, especially when trying to implement our integration, but of course for users as well.

It seems related to this ticket, which was apparently fixed in December.
http://support.transloadit.com/discussions/problems/12543-incorrect-content-type-header-in-assembly-status-results

Hi Will,

That’s strange indeed. Do you by any chance have information about your brower’s request headers? It seems we only serve application/json; charset=utf-8 if the browser also supplies an Accept: *json*.

Maybe the problem is caused by not supplying that? If so we’ll have to find a workaround.

Best,
Kevin

Hey Kevin, thanks for looking into it.

So, the request headers being sent include “Accept: */*”, I see that in both Safari and Chrome on my mac.
In both cases, the server replies with text/plain

I can replicate with one of Tim’s github projects. Download:
https://github.com/tim-kos/transloadit-drag-and-drop
edit the index.html to have an auth key and template_id, and open index.html in Chrome, you should see these errors in the javascript console.

Any thoughts?

-Will

Hi Will,

I think I found a bug in the way we check if the browser will accept json, I’m going to write a fix and let you know when it hits production.

Best,
Kevin