Add server-side validation for frontend errors filtering #10104
Merged
Conversation
changelog: Internal, Error Logging, Ignore frontend errors not originating from application script
zachmargolis
approved these changes
Feb 20, 2024
| private | ||
|
|
||
| def validate_filename_extension | ||
| return if File.extname(filename.to_s) == '.js' |
Contributor
There was a problem hiding this comment.
do we 100% always get the filename? my guess is we'd want to allow a nil filename too just in case?
Contributor
Author
There was a problem hiding this comment.
The spec implies that it must be a string, but that it could (at least by the defaults defined there) be empty. The behavior here matches the behavior on the client-side, which would ignore anything not explicitly .js. Whether we should want to log those, I'd have a mild curiosity what (if anything) would be logged, but generally think we're interested in errors known to be originating from our own scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Adds server-side validation to match the client-side error filtering performed to limit errors to those thrown within Login.gov scripts.
This is a follow-up to the suggestion at #10087 (comment)
📜 Testing Plan
Repeat Testing Plan from #10087