3
1
Fork
You've already forked experimental-plugins
1

Specify import scripts #40

Merged
RickCogley merged 4 commits from main into main 2024年11月09日 12:28:08 +01:00
RickCogley commented 2024年11月09日 06:36:07 +01:00 (Migrated from github.com)
Copy link

For some reason, this experimental plugin stopped working. I noticed it, when trying to add security headers to a site being built on Lume 2.4.1 and Deno 2.x, and hosted on Deno Deploy. The error thrown in the build log was a 404, and when I searched it, there were mentions that it meant the script being sourced on import was not there or had been moved. I looked for the scripts with the functions under lumeland/lume, and specified them.

Secondly, specifying maxAge: DEFAULT_MAX_AGE in my serve.ts failed, with the build process giving an error about a missing reference. Respecifying as a value works:

// pass your preferred security header options:
server.use(csp({
 "Strict-Transport-Security": {
 maxAge: 365 * 24 * 60 * 60, // one year
 includeSubDomains: true,
 preload: true,
 },
 "Referrer-Policy": ["no-referrer", "strict-origin-when-cross-origin"],
 "X-Frame-Options": true,
 "X-Content-Type-Options": true,
 "X-XSS-Protection": true,
 "X-Permitted-Cross-Domain-Policies": true,
 "X-Powered-By": "Lume and sweat, blood, and tears",
}));

The discord has it being called as DEFAULT_MAX_AGE, and I think I was using it before, so I am not sure why it failed.

For some reason, this experimental plugin stopped working. I noticed it, when trying to add security headers to a site being built on Lume 2.4.1 and Deno 2.x, and hosted on Deno Deploy. The error thrown in the build log was a 404, and when I searched it, there were mentions that it meant the script being sourced on import was not there or had been moved. I looked for the scripts with the functions under lumeland/lume, and specified them. Secondly, specifying `maxAge: DEFAULT_MAX_AGE` in my `serve.ts` failed, with the build process giving an error about a missing reference. Respecifying as a value works: ``` // pass your preferred security header options: server.use(csp({ "Strict-Transport-Security": { maxAge: 365 * 24 * 60 * 60, // one year includeSubDomains: true, preload: true, }, "Referrer-Policy": ["no-referrer", "strict-origin-when-cross-origin"], "X-Frame-Options": true, "X-Content-Type-Options": true, "X-XSS-Protection": true, "X-Permitted-Cross-Domain-Policies": true, "X-Powered-By": "Lume and sweat, blood, and tears", })); ``` The discord has it being called as `DEFAULT_MAX_AGE`, and I _think_ I was using it before, so I am not sure why it failed.

Thank you!
yeah, the plugin was created for Lume 1 and wasn't upgraded to Lume 2.
Regarding DEFAULT_MAX_AGE, this is an internal value, is not exported by the module, so you can't use it. But due it's the default value, I think you don't need to use it.

pd: I love your X-Powered-By. I hope it's not entirely true.

Thank you! yeah, the plugin was created for Lume 1 and wasn't upgraded to Lume 2. Regarding `DEFAULT_MAX_AGE`, this is an internal value, is not exported by the module, so you can't use it. But due it's the default value, I think you don't need to use it. pd: I love your X-Powered-By. I hope it's not entirely true.
RickCogley commented 2024年11月09日 12:34:22 +01:00 (Migrated from github.com)
Copy link

maybe a little sweat, but no blood anyway (yet)

maybe a little sweat, but no blood anyway (yet)
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/experimental-plugins!40
Reference in a new issue
lume/experimental-plugins
No description provided.
Delete branch "main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?