invalid content type header #25

Closed
benderamp opened this Issue Mar 23, 2011 · 0 comments

Comments

Projects
None yet
2 participants

Hi,

It seems that mod_upload_progress returns invalid content type in the header of the returned progress status "/progress". It sets "text/javascript" (see line 711 in mod_upload_progress.c) and according this this thread:
http://stackoverflow.com/questions/477816/the-right-json-content-type it should be "application/json".

This might bring problems to some JS-applications which try to validate response data basing on its header. For example firefox+righjs-uploader (http://rightjs.org/ui/uploader) would generate "invalid label" error when tries to handle response from mod_upload_progress - which is correct, cause it tries to handle returned value as javascript and not as plain json.

That was ok for the older version of mod_upload_progress (http://piotrsarnacki.com/2008/06/18/upload-progress-bar-with-mod_passenger-and-apache/) which returned json like this:

new Object({ ‘state’ : ‘starting’ })

new Object(...) directive allowed validator not to generate "invalid label" error.

Now with plain json:
{ ‘state’ : ‘starting’ }

it gives problems.

@drogus drogus added a commit that referenced this issue May 4, 2011

@drogus drogus Merge pull request #27 from dallarosa/master.
Fix for issue #25: invalid content type header
c7b11f5

drogus closed this May 4, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment