-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Preview mode pages can be accessed publicly #16020
Comments
From a quick look, I think this is more of an issue related to the fetch logic in the app code itself. In your I reckon you'd do something like: |
Lets say fetchPost logic is Even if it is wrong in this case and is corrected and made valid in every aspect, if generated page is there in disk then it will be on |
Hi, preview mode pages don't appear to be cached or made available publicly as described, I opened a PR here adding tests for this to our test suite. You might have had the preview mode cookie left set in the browser which made it appear to be available when it shouldn't have been. If this isn't the case and the mentioned PR doesn't capture the case this occurs please reply with additional details and we can investigate further! |
This adds tests to ensure preview mode pages aren't cached and made publicly available or written to the disk. Closes: #16020
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Description
I have a post in draft, path for which is
/posts/id
. I want for rebuild it on request since data is new.So I made it a preview url using preview mode feature. Now the url is
/api/preview?secret=token&slug=/posts/id
.Now when I make this request this page is generated and stored on disk and any one with url
/posts/id
can visit this.To Reproduce
Steps to reproduce
This sandbox is not working because it says res.redirect is not a function (which we can ignore) but you can see code or check repo also.
Go to this sandbox and check
Expected behavior
I am no expert but I think it should not write preview pages on disk, it should serve them from memory. when someone visit
/posts/id
it should return 404.System information
The text was updated successfully, but these errors were encountered: