Skip to content

Conversation

@dhogan8
Copy link
Contributor

@dhogan8 dhogan8 commented Nov 20, 2025

No description provided.

@dhogan8 dhogan8 force-pushed the dallas/automate-headers branch from 64d2f65 to c0807ce Compare November 20, 2025 22:39
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2025

Deploying blog-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1408ea1
Status: ✅  Deploy successful!
Preview URL: https://027f68f3.blog-site-602.pages.dev
Branch Preview URL: https://dallas-automate-headers.blog-site-602.pages.dev

View logs

@dhogan8 dhogan8 force-pushed the dallas/automate-headers branch from c3c7976 to 9d571f3 Compare November 21, 2025 20:01
'Content-Security-Policy': {
// Allow AJAX/fetch requests to status page, marketing site, HubSpot, and Google services
'connect-src': [
'\'self\'',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are still escaped

pattern: '/*',
headers: {
'Content-Security-Policy': {
// Allow AJAX/fetch requests to status page, marketing site, HubSpot, and Google services
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Allow AJAX/fetch requests to status page, marketing site, HubSpot, and Google services

'https://www.maxmind.com',
// HubSpot API endpoint
// https://legacydocs.hubspot.com/docs/faq/how-do-i-create-a-custom-domain-for-my-forms
'https://api.hubspot.com',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placement of comments is confusing; hubspot + google comments are grouped together but they each need to be adjacent to the relevant url(s).

Comment on lines 37 to 51
for (const [
header,
value,
] of Object.entries(pathConfig.headers)) {
if (typeof value === 'object' && !Array.isArray(value)) {
// CSP-style header with directives
const directives: string[] = [];
for (const [
directive,
sources,
] of Object.entries(value)) {
directives.push(`${directive} ${sources.join(' ')}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is weird

/**
* Generate _headers file content from config
*/
function generateHeaders(config: { paths: PathConfig[] }): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not generating the expected output. It's not outputting the proper delimiters (ie ; or ,) for non-CSP values.

Comment on lines 159 to 200
'Referrer-Policy': [
'strict-origin-when-cross-origin',
],
'Strict-Transport-Security': [
'max-age=63072000',
'includeSubDomains',
'preload',
],
'X-Content-Type-Options': [
'nosniff',
],
'X-Frame-Options': [
'DENY',
],
'X-XSS-Protection': [
'1',
'mode=block',
],
},
},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is weird

@dhogan8 dhogan8 force-pushed the dallas/automate-headers branch from c447250 to 1408ea1 Compare December 1, 2025 00:22
@dhogan8 dhogan8 requested a review from mm-kevcenteno December 1, 2025 00:24
@dhogan8 dhogan8 merged commit 4e864cd into main Dec 1, 2025
15 checks passed
@dhogan8 dhogan8 deleted the dallas/automate-headers branch December 1, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants