Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Redirect for preview mode #10

Closed
Closed
@nikshenoy

Description

@nikshenoy

The Next.js samples for preview mode involve doing a redirection from an api route. The code is something like:

  res.setPreviewData({
    maxAge: 60 * 60 // The preview mode cookies expire in 1 hour
  })

  res.writeHead(307, { Location: `/${req.query.contentType}/${req.query.slug}` })

I can do this from next run, but if I try this on Netlify it seems to strip the location header on the 307 redirect. Is this something to do with the compat call or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions