Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
doc-utils
doc-utils
Commits
b28423a5
Commit
b28423a5
authored
Jun 06, 2019
by
Ingo Meyer
Browse files
Use a default `User-Agent` when downloading images (`Mozilla/5.0`)
parent
e061ffed
Changes
1
Hide whitespace changes
Inline
Side-by-side
docutils_extended/directives/embedded_image_directive.py
View file @
b28423a5
...
...
@@ -49,7 +49,7 @@ def load_and_convert_image(
tmp_dir
=
None
if
image_is_remote
:
image_url
=
image_filepath_or_url
response
=
requests
.
get
(
image_url
)
response
=
requests
.
get
(
image_url
,
headers
=
{
"User-Agent"
:
"Mozilla/5.0"
}
)
response
.
raise_for_status
()
image_content
=
response
.
content
if
not
convert_to_base64
or
image_will_be_converted
:
...
...
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