-
Notifications
You must be signed in to change notification settings - Fork 65
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
invalid header rules
due to exceeds the maximum allowed length of 2000
on CloudFlare
#606
Comments
Hey there, Thanks for reporting this issue. I think it is a duplicate of #504. Could you share your case there so that we can keep track of it there? :) |
Hi @Baroshem, I saw that issue, but it's a different problem. #504 is about the maximum allowed count of header rules, which is mainly dependent on the amount of pages one has. This issue is about the maximum line length of a single header (specifically I assume, that such a long header might also be problematic under other (non-CloudFlare) circumstances or environments. |
Ah I see, thanks for clarification. It seems that as you mentioned it is caused the the SHA's but based on my knowledge this is how it is supposed to work (generate SHA for each script). Please correct me if I am wrong here @vejja - can we somehow provide a fix for that? |
I see |
@Baroshem, @vejja
Here is the head (I've removed all <head>
<meta charset="utf-8" />
<meta
http-equiv="Content-Security-Policy"
content="base-uri 'none'; font-src 'self' https: data:; form-action 'self'; img-src 'self' data:; object-src 'none'; script-src-attr 'none'; style-src 'self' https: 'unsafe-inline'; script-src 'self' https: 'unsafe-inline' 'strict-dynamic' 'sha256-ivIk8jaIlJqI/VSuZ8WHKfP9c9l7LuFY9r+imeCj5ZU=' 'sha256-s7Gxndj2Fs1Svxn4Ebnl9mbhGNWS24dfQiqkJqtLORg=' 'sha256-txDvJsTLV/6i1zmOdtyVSzv2RLT6MkALP2DDZqmtCD4=' 'sha256-QvQBjbj2aQY2P9qTWwSytonvotg/78METR6U18ggmkM=' 'sha256-g6IsjQHgKALf5QtDySRTgavUSFYe0FfgDyOdLkzsLwc=' 'sha256-fDvWSMyiCDTo5V7EOLKIsWRCl0jJ+oo6ZjjheIsIRls=' 'sha384-4wfGye9ie622jNW15gO5XJswu86+pVupqh1XnmnepYG2aQOCInQmWmfdyLeALaGe' 'sha384-E8i6wIfdEhoGSk4bMkt1GrgOmzMuiLf7EB4ldCa8ASpWBcAPBiEE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hkL45NzofJFWNTnbWqZkwXt3+/56fnSdH5mU3UfcjuyP92yZJc8K' 'sha384-MvIB40081t78tAmeEgXeovkzpiw1sw7aYHGXEshaIPUakruMbepSE0+xhIoSrWgd' 'sha384-FEs3yfhdBo6v8Qz0cz4ZmY41DAI2kfCN5s9jSoN6Nq5ZlPEbKm0MEFt/39mcfXCt' 'sha384-OmH0m6yVy2O+LkDsjv34Bmqe+/IdvWg+lQQugedxLrB6hQd+wNF6TMDdjcohEVbi'; upgrade-insecure-requests;"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Home - My Website</title>
<link
rel="preload"
as="image"
imagesrcset="/assets/images/639x426/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 639w, /assets/images/767x511/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 767w, /assets/images/1023x682/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1023w, /assets/images/1278x852/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1278w, /assets/images/1279x853/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1279w, /assets/images/1534x1022/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1534w, /assets/images/1535x1023/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1535w, /assets/images/1920x1280/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 1920w, /assets/images/2046x1364/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 2046w, /assets/images/2558x1706/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 2558w, /assets/images/3070x2046/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 3070w, /assets/images/3840x2560/smart/filters:format(webp):quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg 3840w"
imagesizes="(max-width: 640px) 639px, (max-width: 768px) 767px, (max-width: 1024px) 1023px, (max-width: 1280px) 1279px, (max-width: 1536px) 1535px, (max-width: 2048px) 1920px, 1920px"
/>
<meta name="msapplication-TileColor" content="#aa191e" />
<meta name="theme-color" content="#ffffff" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link
rel="shortcut icon"
type="image/png"
href="/favicon.ico"
sizes="96x96"
/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="description" content="This is my website." />
<meta name="robots" content="index,follow" />
<meta property="og:url" content="https://my-url.example.com" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="My Website" />
<meta property="og:locale" content="de" />
<meta property="og:title" content="Home - My Website" />
<meta property="og:description" content="This is my website." />
<meta name="apple-mobile-web-app-title" content="My Website" />
<meta name="application-name" content="My Website" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:site" content="@my-website" />
<meta property="twitter:creator" content="@me" />
<meta property="twitter:url" content="https://my-url.example.com" />
<meta name="twitter:title" content="Home - My Website" />
<meta name="twitter:description" content="This is my website." />
<meta
property="og:image"
content="/assets/images/1200x630/smart/filters:quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg"
/>
<meta
name="twitter:image"
content="/assets/images/1200x630/smart/filters:quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg"
/>
<link rel="canonical" href="https://my-url.example.com" />
<link rel="alternate" hreflang="de" href="https://my-url.example.com/" />
<link rel="alternate" hreflang="en" href="https://my-url.example.com/en" />
<script type="application/ld+json" data-hid="6553f88">
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://my-url.example.com/#website",
"url": "https://my-url.example.com",
"name": "My Website"
}
</script>
<script type="application/ld+json" data-hid="5bc3eb6">
{
"@context": "https://schema.org",
"@type": "WebPage",
"url": "https://my-url.example.com",
"inLanguage": "de-DE",
"name": "Home - My Website",
"description": "This is my website.",
"breadcrumb": {
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@type": "WebPage",
"@id": "https://my-url.example.com",
"url": "https://my-url.example.com",
"name": "Home"
}
}
]
}
}
</script>
<script type="application/ld+json" data-hid="758233f">
{
"@context": "https://schema.org",
"@type": "ImageObject",
"@id": "https://my-url.example.com/#primaryimage",
"url": "/assets/images/1200x630/smart/filters:quality(80)/f/289247/1920x1280/46ffc05d85/architektur_204.jpg"
}
</script>
<script type="application/ld+json" data-hid="7fe4105">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Adwerba",
"legalName": "Adwerba",
"address": {
"@type": "PostalAddress",
"addressCountry": "AT",
"addressLocality": "Salzburg",
"postalCode": "5020",
"streetAddress": "Schallmooser Hauptstraße 85A "
},
"geo": {
"@type": "GeoCoordinates",
"latitude": "47.80827789588115",
"longitude": "13.06094056931345"
},
"image": null,
"logo": null,
"email": "[email protected]",
"url": "https://my-url.example.com",
"telephone": "+43 662 64 31 25",
"faxNumber": null
}
</script>
<script
integrity="sha384-4wfGye9ie622jNW15gO5XJswu86+pVupqh1XnmnepYG2aQOCInQmWmfdyLeALaGe"
type="module"
src="/_nuxt/MSjzoOib.js"
crossorigin
></script>
</head> Let me know, if you need any more info! |
Hmm, putting this in nuxt-config: security: {
ssg: {
exportToPresets: false
}
}, ... results in these error messages:
|
One of your modules (or - less likely - yourself) is inserting inline event handlers. |
Environment
Nuxt Security Version
v2.1.5
Default setup used?
Yes, the bug happens even if the security option is not customized
Security options
Reproduction
Description
Many thanks for creating this package!
When building my app for hosting on CloudFlare, SSG prerendered pages result in the following warning:
Looking at the generated
dist/_headers
file, thecontent-security-policy
header and specifically all the sha256-hashes seem to be the problem.Here is an example:
Is there any way to mitigate this? Should i simply use
contentSecurityPolicy: false
?Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: