Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
b5932d06
Unverified
Commit
b5932d06
authored
Oct 25, 2021
by
Padmashree Jha
Committed by
GitHub
Oct 25, 2021
Browse files
Add total User-Agent (#2551)
parent
1853dedb
Changes
1
Show whitespace changes
Inline
Side-by-side
build/validate_links.py
View file @
b5932d06
...
@@ -56,9 +56,9 @@ def validate_links(links):
...
@@ -56,9 +56,9 @@ def validate_links(links):
if
host
[:
3
]
==
'www'
:
if
host
[:
3
]
==
'www'
:
host
=
host
[
4
:]
host
=
host
[
4
:]
resp
=
h
.
request
(
link
,
headers
=
{
resp
=
h
.
request
(
link
+
"/"
,
headers
=
{
# Faking user agent as some hosting services block not-whitelisted UA
# Faking user agent as some hosting services block not-whitelisted UA
'
u
ser-
a
gent'
:
'Mozilla/5.0'
,
'
U
ser-
A
gent'
:
'Mozilla/5.0
(Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1467.0 Safari/537.36
'
,
# setting host because Cloudflare returns 403 asking for captcha if host is missing
# setting host because Cloudflare returns 403 asking for captcha if host is missing
'host'
:
host
'host'
:
host
})
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment