Skip to content

Commit 35c38d7

Browse files
authored
Merge pull request #116 from web-genie-ai/feat/update-validation
Feat/update validation
2 parents 073e363 + df00cb0 commit 35c38d7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

webgenie/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Change this value when updating your code base.
55
# Define the version of the webgenie.
6-
__VERSION__ = "1.1.17" # version
6+
__VERSION__ = "1.1.18" # version
77

88
SPEC_VERSION = (
99
(1000 * int(__VERSION__.split(".")[0]))

webgenie/helpers/htmls.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def is_valid_resources(html_content: str) -> bool:
2929
r"https?://stackpath.bootstrapcdn.com/bootstrap/[^/]+/css/bootstrap.min.css",
3030
r"https?://code.jquery.com/jquery-[^/]+.min.js",
3131
r"https?://stackpath.bootstrapcdn.com/bootstrap/[^/]+/js/bootstrap.bundle.min.js",
32+
r"https?://cdnjs.cloudflare.com/ajax/libs/font-awesome/[^/]+/css/font-awesome.min.css",
33+
r"https?://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap",
3234
]
3335

3436
soup = BeautifulSoup(html_content, 'html.parser')
@@ -38,11 +40,11 @@ def is_valid_resources(html_content: str) -> bool:
3840
if resource.name == 'link' and resource.get('rel') == ['stylesheet']:
3941
href = resource.get('href')
4042
if href and not any(re.match(pattern, href) for pattern in allowed_patterns):
41-
return False
43+
return True
4244
elif resource.name == 'script':
4345
src = resource.get('src')
4446
if src and not any(re.match(pattern, src) for pattern in allowed_patterns):
45-
return False
47+
return True
4648

4749
return True
4850

0 commit comments

Comments
 (0)