Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Merge requests
!134
Refactor
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Refactor
refactor
into
develop
Overview
0
Commits
48
Pipelines
0
Changes
1
Merged
Bjarke Madsen
requested to merge
refactor
into
develop
7 months ago
Overview
0
Commits
48
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
710640ec
Prev
Next
Show latest version
1 file
+
4
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
710640ec
check if adding scheme makes a valid URL
· 710640ec
Bjarke Madsen
authored
7 months ago
compendium_v2/publishers/helpers.py
+
4
−
1
Options
@@ -46,8 +46,11 @@ def extract_urls(text: str) -> List[str]:
def
valid_url
(
url
:
str
)
->
bool
:
try
:
parsed
=
url_parse
(
url
)
valid
=
bool
(
parsed
)
if
not
valid
:
# if it's valid with the scheme added, then we're fine
parsed
=
url_parse
(
'
http://
'
+
url
)
valid
=
bool
(
parsed
)
except
Exception
:
valid
=
False
return
valid
Loading