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

Use the whole string instead of a single line for template match #431

Merged
merged 2 commits into from Jul 30, 2022

Conversation

ojab
Copy link
Contributor

@ojab ojab commented Sep 2, 2021

Multiline strings shouldn't pass the validation if a single line matches.

spec/addressable/template_spec.rb Outdated Show resolved Hide resolved
spec/addressable/template_spec.rb Outdated Show resolved Hide resolved
@ojab ojab force-pushed the ct-_do_not_parse_multiline_strings branch from a2f32c7 to 22af13f Compare September 2, 2021 11:29
@ojab ojab marked this pull request as ready for review September 2, 2021 11:59
@ojab
Copy link
Contributor Author

ojab commented Sep 2, 2021

Marking as ready for review because First-time contributors need a maintainer to approve running workflows.

Copy link
Collaborator

@therabidbanana therabidbanana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good change - supporting multi line strings was definitely not intentional 👍

@@ -77,6 +77,15 @@
end
end

describe "#to_regexp" do
it "does not match the first line of multiline strings" do
uri = "https://www.example.com/bar"

Check failure

Code scanning / CodeQL

Incomplete regular expression for hostnames

This string, which is used as a regular expression [here](1), has an unescaped '.' before 'example.com/bar', so it might match more hosts than expected. This string, which is used as a regular expression [here](2), has an unescaped '.' before 'example.com/bar', so it might match more hosts than expected.
@sporkmonger sporkmonger merged commit 99810af into sporkmonger:main Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants