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 tweak #138

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class PatternMatch(object):
rb"(?:[\w!$-.:;=~@]{,2000}@)?" # userinfo
rb"(?:[A-Z0-9.-]{4,253}|\[[0-9A-F:]{3,39}\])" # hostname
rb"(?::(?:6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5]?[0-9]{0,4}))?" # port
rb"(?:[/?#](?:[\w!#$-/:;=@?~]{,2000}[\w!#$%&(*+\-/:;=@?~])?)?" # path, query and fragment
rb"(?:[/?#](?:[\w!#$-/:;=@?~]{,2000}[\w!#$%&(*+\-/:=@?~])?)?" # path, query and fragment
)
PAT_ANYHTTP = (
rb"(?i)http://"
Expand Down
3 changes: 2 additions & 1 deletion test/balbuzard/test_patterns.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re

import pytest

from assemblyline_service_utilities.common.balbuzard.patterns import PatternMatch


Expand Down Expand Up @@ -70,6 +69,8 @@ def test_PAT_URL_basic_auth(url):
(b"barefunction(https://example.com)", 1),
(b'in a string content "https://example.com"works.', 7),
(b"whitespaceless('https://example.com'){script;}", 11),
(b"'https://example.com/';", 2),
(b"('https://example.com'); ", 4),
],
)
def test_PAT_URL_in_context(url, suffix_len):
Expand Down