Skip to content

Commit

Permalink
[cms-sanity] Use slug from post instead of query params
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Dec 17, 2020
1 parent 94837e0 commit 8edf408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/cms-sanity/pages/api/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export default async function preview(req, res) {

// Redirect to the path from the fetched post
// We don't redirect to req.query.slug as that might lead to open redirect vulnerabilities
res.writeHead(307, { Location: `/posts/${req.query.slug}` })
res.writeHead(307, { Location: `/posts/${post.slug}` })
res.end()
}

0 comments on commit 8edf408

Please sign in to comment.