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: Return 404 if a custom script or style is not found #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wsamoht
Copy link
Contributor

@wsamoht wsamoht commented Oct 26, 2024

My site has gotten hit by a malicious actor several times hitting the routes to load the custom scripts or styles with non-existent scripts/styles.

An example being /docs/scripts/non-existent-504843668 (with the number being different each time) and /docs/styles/non-existent-945848484.

When this happens, we get a ton of errors because when these non-existent scripts/styles try to get loaded, a 500 is thrown with the error Undefined array key "non-existent-504843668".

I have fixed this so instead of a 500 being thrown, a 404 is returned.

Move abort inline with previous code

Fix test names
@wsamoht wsamoht force-pushed the fix-scripts-styles-not-found branch from ba64bad to 8d0a573 Compare October 26, 2024 17:17
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.

1 participant