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

url payload generator should detect all-caps protocol #447

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

mharen
Copy link
Contributor

@mharen mharen commented Feb 27, 2023

Summary

Updates Url Payload Generator to better handle when a given url includes HTTP/HTTPS.

This PR fixes/implements the following bugs/features:

  • Bug: URL Payload Generator incorrectly prefixes http:// to inputs that already include HTTP://

Test plan

  • unit test added to verify correct behavior
  • make sure solution builds and tests run sucessfully

QRCoder/PayloadGenerator.cs Outdated Show resolved Hide resolved
@Shane32
Copy link
Contributor

Shane32 commented Apr 6, 2024

The changes here do not fail any tests. I suggest merging the PR.

@codebude codebude merged commit a24c984 into codebude:master Apr 17, 2024
3 checks passed
@mharen
Copy link
Contributor Author

mharen commented Apr 17, 2024

Thanks!

@codebude
Copy link
Owner

Hi @mharen , hi @Shane32 ,

thanks for your help. The change fixes the problem, thus I merged it. :-)
In future I propably will replace it by a Regex, because I think the startswith solution is somehow weak. Think about an input like "http-service.com". It would be matched by the startswith and the generator wouldn't prefix it, even if the protocol is missing.
With an Regex we may avoid it: https://regex101.com/r/PbTCnq/1

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.

3 participants