Skip to content
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

fix(hsts): resolve path for hsts-preload.json file #41

Merged
merged 2 commits into from
Jul 23, 2024
Merged

Conversation

bikerdave
Copy link
Contributor

@bikerdave bikerdave commented Jul 19, 2024

Description

This change correctly resolves the relative path for fs.readFileSync() which gets the contents of the hsts-preload.json file.

Motivation

I'm importing this library into an existing Node application. But when I run the main scan() function, the hsts() function fails to read the hsts-preload.json file due to the path resolving relative to the Node process. By utilising the import.meta object it is possible to read the file correctly.

BEGIN_COMMIT_OVERRIDE
fix(hsts): resolve path for hsts-preload.json file
END_COMMIT_OVERRIDE

Copy link
Contributor

It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@bikerdave bikerdave marked this pull request as ready for review July 19, 2024 15:39
@bikerdave bikerdave requested a review from a team as a code owner July 19, 2024 15:39
Copy link
Contributor

@argl argl left a comment

Choose a reason for hiding this comment

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

Many thanks for your contribution, approved.

@argl argl merged commit 0ea5178 into mdn:main Jul 23, 2024
2 checks passed
Copy link
Contributor

Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution.

@caugner caugner changed the title Resolve path for hsts-preload.json file fix(hsts): resolve path for hsts-preload.json file Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants