fyiorgnz / alaveteli

OIA/LGOIMA (Freedom of Information) request system: New Zealand fork of mysociety/alaveteli
https://fyi.org.nz/
Other
4 stars 3 forks source link

405 error on uploads #12

Open olineham opened 6 years ago

olineham commented 6 years ago

Seen in FF63 when using a generated "upload URL" to respond through the web with a 65MB file. The browser is redirected after the upload, but gets:

405 Method Not Allowed

    Code: MethodNotAllowed
    Message: The specified method is not allowed against this resource.
    Method: POST
    ResourceType: OBJECT
    RequestId: D271D0FEAEADA49E
    HostId: wn1phkwScnRNA+/JN+ocDv+vkxVhzKj73tTZp+tBLmH8W6MEZ+Mu0YssweT9EfF2wap4TdoI2iA=

Most likely the wrong kind of redirect which causes the browser to re-POST not switch to GET (e.g. 307 instead of 303, or a 302 with the browser surprisingly adhering to spec by not changing method).

nigeljonez commented 5 years ago

This is similar to the issue Mark reported on Slack the other week while trying to update the profile image, I think our NGINX is trying to POST to the error/maintenance page S3 container which is obviously disallowed.

We are going to need to revamp the nginx config to ensure it is serving assets correctly for the current update so I might fix it then, else it'll be fyi-next+1. (Target for fyi-next+1 but it might get fixed in the process of fyi-next)