mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
[diff facebook/[email protected]](https://github.com/facebook/react/compare/fef12a01...da9325b5) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/35962 - https://github.com/facebook/react/pull/35961 - https://github.com/facebook/react/pull/36277 - https://github.com/facebook/react/pull/36297 - https://github.com/facebook/react/pull/36292 - https://github.com/facebook/react/pull/36291 - https://github.com/facebook/react/pull/36196 - https://github.com/facebook/react/pull/36246 - https://github.com/facebook/react/pull/36287 - https://github.com/facebook/react/pull/36285 - https://github.com/facebook/react/pull/36274 - https://github.com/facebook/react/pull/36266 - https://github.com/facebook/react/pull/36253 </details>
34 lines
887 B
TypeScript
34 lines
887 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { check } from 'next-test-utils'
|
|
import { join } from 'path'
|
|
|
|
describe('app-dir action disallowed origins', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: join(__dirname, 'unsafe-origins'),
|
|
skipDeployment: true,
|
|
dependencies: {
|
|
'server-only': 'latest',
|
|
},
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
// Origin should be localhost
|
|
it('should error if x-forwarded-host does not match the origin', async function () {
|
|
const browser = await next.browser('/')
|
|
|
|
await browser.elementByCss('button').click()
|
|
|
|
await check(async () => {
|
|
const t = await browser.elementByCss('#res').text()
|
|
return t.includes('Invalid Server Actions request.') ||
|
|
// In prod the message is hidden
|
|
t.includes('https://react.dev/errors/441')
|
|
? 'yes'
|
|
: 'no'
|
|
}, 'yes')
|
|
})
|
|
})
|