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

Reconsider regex for URL scheme #1238

Open
adatzer opened this issue Sep 15, 2023 · 0 comments
Open

Reconsider regex for URL scheme #1238

adatzer opened this issue Sep 15, 2023 · 0 comments
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.

Comments

@adatzer
Copy link
Contributor

adatzer commented Sep 15, 2023

Describe the bug

Currently this regex is used to validate the protocol scheme. This means that a protocol like safari-web-extention will become null.

This can result in unexpected behaviour for setCustomUrl, if it is called with a url whose protocol does not conform to this regex. In that case, the url argument gets appended to base url.

To Reproduce

Example for JavaScript tracker, setup the tracker and call:

snowplow('setCustomUrl', 'safari-web-extention://whatever.com');

Expected behavior

That setCustomUrl sets the url to its argument independent of protocol scheme.

Additional context

  • Currently the page_urlscheme is also a Snowplow atomic property, whose current max length is 16, which results in events getting invalidated if their page url has a protocol longer than that.
  • See also: RFC 2396 Scheme Component
@adatzer adatzer added the type:defect Bugs or weaknesses. The issue has to contain steps to reproduce. label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.
Projects
None yet
Development

No branches or pull requests

1 participant