trevorturk / flash_cookie_session

Rails 3 cookie sessions can cooperate with Flash
79 stars 16 forks source link

406 Not Acceptable error #4

Closed vamsee closed 13 years ago

vamsee commented 13 years ago

I'm getting a pretty weird error. After I setup the gem (with plupload, Rails 3.0.3, flash_cookie_session v1.1.0), apparently the upload seems to work, but the return status giving me a "Completed 406 Not Acceptable" and the flash uploader shows it as an error due to this. I tried disabling the line which sets the HTTP_ACCEPT header in middleware.rb file, but that doesn't seem to help.

trevorturk commented 13 years ago

I'm not sure... I've only tested this with Rails 3.0.1. Do you have any kind of stack trace or something? I don't know what to go on.

vamsee commented 13 years ago

Managed to fix this. Turns out that by default the HTTP_ACCEPT header is set to 'text/plain'. The respond_to block in the controller action which handles the upload fails because it can by default only handle html and xml. I had to set the value of _http_accept to 'text/html' in the form to fix this. Not sure if this default value has to be set in the gem or a simple note would do?

trevorturk commented 13 years ago

Would you mind adding a note to the readme and sending a pull request? I think that would be a good start, at least.

trevorturk commented 13 years ago

Closing in favor of pull request.