Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong behaviour when a page dose not exists #2889

Closed
fedor-shi opened this issue Sep 1, 2017 · 2 comments
Closed

Wrong behaviour when a page dose not exists #2889

fedor-shi opened this issue Sep 1, 2017 · 2 comments

Comments

@fedor-shi
Copy link

I scanned my website with a security scanner and there are a lot warnings when it try to get the pages from the _next/HASH/page/* url

Expected Behavior

GET /_next/2025e8cd-80d3-454a-bf9f-ddd04aedcd3d/page/admin.aspx

should return the 404 error code with my 404 error page

Current Behavior

GET /_next/2025e8cd-80d3-454a-bf9f-ddd04aedcd3d/page/admin.aspx

I get the 200 status code and this text in the browser

window.__NEXT_REGISTER_PAGE('/admin.aspx', function() {
        var error = new Error('Page does not exist: /admin.aspx')
        error.statusCode = 404

        return { error: error }
      })
@niccai
Copy link

niccai commented Nov 17, 2017

FWIW, this is quite problematic when using a cloud platform like Fastly. During a purge, you could get a stale html doc returned that references the js from a previous immutable build. If this didn't return a 200, fastly would be able to more accurately deal with the transition to the new deploy.

@timneutkens
Copy link
Member

Fixed in next@canary.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants