You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test passes because Django is returning a 404 properly. Although, in production, that response is passed to NGINX who looks for the X-Accel-Redirect header and serve that file directly from disk. At this point, because NGINX found that file and was able to serve it properly, it adds the 200 in the response.
As we don't use NGINX at all for our tests, it succees.
and do we need to use the serve() or render() instead of _serve_file() method from django to serve this?
I suppose we need to use serve since it's a regular file, not a template.
Currently, we are serving the
404.html
from NGINX returning aResponse
that includes theX-Accel-Redirect
header:https://github.com/rtfd/readthedocs.org/blob/537f7b8d2e8d81f8243d1d4a562968e472bc6337/readthedocs/core/views/__init__.py#L208-L210
We found that even marking the
response.status_code = 404
, the response is 200.To fix this, we have to serve this file directly from Django instead of using this header.
The text was updated successfully, but these errors were encountered: