Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
c7112126
Commit
c7112126
authored
Feb 09, 2015
by
Adam Tauber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] image proxify utf urls
parent
67df3c51
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
webapp.py
searx/webapp.py
+3
-4
No files found.
searx/webapp.py
View file @
c7112126
...
...
@@ -215,15 +215,14 @@ def image_proxify(url):
if
url
.
startswith
(
'//'
):
url
=
'https:'
+
url
url
=
url
.
encode
(
'utf-8'
)
if
not
settings
[
'server'
]
.
get
(
'image_proxy'
)
and
not
request
.
cookies
.
get
(
'image_proxy'
):
return
url
h
=
hashlib
.
sha256
(
url
+
settings
[
'server'
][
'secret_key'
]
.
encode
(
'utf-8'
))
.
hexdigest
()
hash_string
=
url
+
settings
[
'server'
][
'secret_key'
]
h
=
hashlib
.
sha256
(
hash_string
.
encode
(
'utf-8'
))
.
hexdigest
()
return
'{0}?{1}'
.
format
(
url_for
(
'image_proxy'
),
urlencode
(
dict
(
url
=
url
,
h
=
h
)))
urlencode
(
dict
(
url
=
url
.
encode
(
'utf-8'
)
,
h
=
h
)))
def
render
(
template_name
,
override_theme
=
None
,
**
kwargs
):
...
...
Write
Preview
Markdown
is supported
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