Skip to content

Commit

Permalink
Merge pull request #138 from CybercentreCanada/url_tweak
Browse files Browse the repository at this point in the history
Url tweak
  • Loading branch information
cccs-jh authored Apr 9, 2024
2 parents fb164bf + 9a0154a commit f2b6272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit f2b6272

Please sign in to comment.