Skip to content

Commit

Permalink
Merge branch 'canary' into 5860-safari-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Feb 22, 2020
2 parents 41a2053 + 0890b58 commit 538df8a
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/custom-server-typescript/nodemon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"watch": ["server", "static"],
"watch": ["server"],
"exec": "ts-node --project tsconfig.server.json server/index.ts",
"ext": "js ts"
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "9.2.3-canary.8"
"version": "9.2.3-canary.9"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-google-analytics",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"nextjs": {
"name": "Google Analytics",
"required-env": [
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-material-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-material-ui",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"nextjs": {
"name": "Material UI",
"required-env": []
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-sentry",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"nextjs": {
"name": "Sentry",
"required-env": [
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
10 changes: 8 additions & 2 deletions packages/next/next-server/server/api-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,19 @@ function clearPreviewData<T>(res: NextApiResponse<T>): NextApiResponse<T> {
? previous
: []),
serialize(COOKIE_NAME_PRERENDER_BYPASS, '', {
maxAge: 0,
// To delete a cookie, set `expires` to a date in the past:
// https://tools.ietf.org/html/rfc6265#section-4.1.1
// `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.
expires: new Date(0),
httpOnly: true,
sameSite: 'strict',
path: '/',
}),
serialize(COOKIE_NAME_PRERENDER_DATA, '', {
maxAge: 0,
// To delete a cookie, set `expires` to a date in the past:
// https://tools.ietf.org/html/rfc6265#section-4.1.1
// `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.
expires: new Date(0),
httpOnly: true,
sameSite: 'strict',
path: '/',
Expand Down
4 changes: 2 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "9.2.3-canary.8",
"version": "9.2.3-canary.9",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -73,7 +73,7 @@
"@babel/preset-typescript": "7.7.2",
"@babel/runtime": "7.7.2",
"@babel/types": "7.7.4",
"@next/polyfill-nomodule": "9.2.3-canary.8",
"@next/polyfill-nomodule": "9.2.3-canary.9",
"amphtml-validator": "1.0.30",
"async-retry": "1.2.3",
"async-sema": "3.0.0",
Expand Down
7 changes: 5 additions & 2 deletions test/integration/prerender-preview/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,25 @@ function runTests() {

const cookies = res.headers
.get('set-cookie')
.replace(/(=\w{3}),/g, '$1')
.split(',')
.map(cookie.parse)

expect(cookies.length).toBe(2)
expect(cookies[0]).toMatchObject({
Path: '/',
SameSite: 'Strict',
'Max-Age': '0',
Expires: 'Thu 01 Jan 1970 00:00:00 GMT',
})
expect(cookies[0]).toHaveProperty('__prerender_bypass')
expect(cookies[0]).not.toHaveProperty('Max-Age')
expect(cookies[1]).toMatchObject({
Path: '/',
SameSite: 'Strict',
'Max-Age': '0',
Expires: 'Thu 01 Jan 1970 00:00:00 GMT',
})
expect(cookies[1]).toHaveProperty('__next_preview_data')
expect(cookies[1]).not.toHaveProperty('Max-Age')
})

/** @type import('next-webdriver').Chain */
Expand Down

0 comments on commit 538df8a

Please sign in to comment.