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/import lunr #383

Merged
merged 6 commits into from
Mar 12, 2024
Merged

Fix/import lunr #383

merged 6 commits into from
Mar 12, 2024

Conversation

alexanderleegs
Copy link
Contributor

@alexanderleegs alexanderleegs commented Mar 12, 2024

This PR fixes issues introduced by #380. Our CSP disallows inline scripts, so creating the script element using new Function would cause issues. This CSP reverts to using importScripts, but only after the integrity has been verified via fetch. It also fixes a bug where the worker script was being called on every pass instead of just through the worker context.

To be reviewed in conjunction with opengovsg/isomer-build#62 and opengovsg/isomer-build#63, as fetch requires new connect-src rules. No longer necessary - we now use a different script src which is already whitelisted

Can be tested on https://staging.duyfy15grdtiq.amplifyapp.com/search/?query=lorem

@alexanderleegs alexanderleegs requested a review from a team March 12, 2024 01:57
@alexanderleegs alexanderleegs changed the base branch from next-gen to next-gen-develop March 12, 2024 05:32
Copy link

@timotheeg timotheeg left a comment

Choose a reason for hiding this comment

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

lgtm

@alexanderleegs alexanderleegs merged commit bbd2aaf into next-gen-develop Mar 12, 2024
3 checks passed
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