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
a988dcb8
Unverified
Commit
a988dcb8
authored
Oct 19, 2020
by
Pierre-Yves Aillet
Committed by
GitHub
Oct 19, 2020
Browse files
Adjust links validation user-agent to real value (#1427)
parent
dc903e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/validate_links.py
View file @
a988dcb8
...
...
@@ -24,7 +24,7 @@ def validate_links(links):
for
link
in
links
:
h
=
httplib2
.
Http
(
disable_ssl_certificate_validation
=
True
,
timeout
=
25
)
try
:
resp
=
h
.
request
(
link
,
headers
=
{
'user-agent'
:
'
Mozilla/5.0
'
})
resp
=
h
.
request
(
link
,
headers
=
{
'user-agent'
:
'
python-httplib2/0.9.2
'
})
code
=
int
(
resp
[
0
][
'status'
])
# check if status code is a client or server error
if
code
>=
404
:
...
...
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