This repository has been archived by the owner. It is now read-only.
fix(metrics): drop invalid utm_ params from flow data #4431
Conversation
| @@ -28,7 +27,7 @@ const FLOW_BEGIN_EVENT_TYPES = /^flow\.[a-z_-]+\.begin$/; | |||
| const FLOW_ID_KEY = config.get('flow_id_key'); | |||
| const FLOW_ID_EXPIRY = config.get('flow_id_expiry'); | |||
|
|
|||
| const ENTRYPOINT_PATTERN = /^[\w\.-]+$/; | |||
| const ENTRYPOINT_PATTERN = /^[\w.-]+$/; | |||
philbooth
Nov 21, 2016
Author
Contributor
The period doesn't need escaping here because it's inside a character class. Updated to be consistent with the new regex below.
The period doesn't need escaping here because it's inside a character class. Updated to be consistent with the new regex below.
|
Only just realised there's failing tests on this PR, sorry. Closing, will re-open when fixed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #4415, silently dropping
utm_*parameters that contain any dodgy-looking characters. Note that this is different treatment than the rest of the flow data, where the whole event is dropped for invalid data. The values for those params are under our control, whereas these aren't.Can be tested by manually adding utm_ params to the URL. Those containing valid characters should show up in the flow event, like so:
Any that contain invalid characters should not be present in the flow event.
There is also a secondary fix contained herein; we agreed to ditch
utm_termentirely because it's completely free-form and we have don't envisage wanting to analyse it in this way.@vladikoff r?