Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
captainwong
douban-api-proxy
Commits
ee3541d7
Commit
ee3541d7
authored
5 years ago
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix kobo links for reverse proxies with subdomains (and docker?) #1470
parent
8608ff11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
kobo.py
cps/kobo.py
+1
-3
reverseproxy.py
cps/reverseproxy.py
+1
-0
No files found.
cps/kobo.py
View file @
ee3541d7
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
import
base64
import
base64
import
datetime
import
datetime
import
itertools
import
json
import
sys
import
sys
import
os
import
os
import
uuid
import
uuid
...
@@ -267,7 +265,7 @@ def HandleMetadataRequest(book_uuid):
...
@@ -267,7 +265,7 @@ def HandleMetadataRequest(book_uuid):
def
get_download_url_for_book
(
book
,
book_format
):
def
get_download_url_for_book
(
book
,
book_format
):
if
not
current_app
.
wsgi_app
.
is_proxied
:
if
not
current_app
.
wsgi_app
.
is_proxied
:
if
':'
in
request
.
host
and
not
request
.
host
.
endswith
(
']'
)
:
if
':'
in
request
.
host
and
not
request
.
host
.
endswith
(
']'
):
host
=
""
.
join
(
request
.
host
.
split
(
':'
)[:
-
1
])
host
=
""
.
join
(
request
.
host
.
split
(
':'
)[:
-
1
])
else
:
else
:
host
=
request
.
host
host
=
request
.
host
...
...
This diff is collapsed.
Click to expand it.
cps/reverseproxy.py
View file @
ee3541d7
...
@@ -77,6 +77,7 @@ class ReverseProxied(object):
...
@@ -77,6 +77,7 @@ class ReverseProxied(object):
servr
=
environ
.
get
(
'HTTP_X_FORWARDED_HOST'
,
''
)
servr
=
environ
.
get
(
'HTTP_X_FORWARDED_HOST'
,
''
)
if
servr
:
if
servr
:
environ
[
'HTTP_HOST'
]
=
servr
environ
[
'HTTP_HOST'
]
=
servr
self
.
proxied
=
True
return
self
.
app
(
environ
,
start_response
)
return
self
.
app
(
environ
,
start_response
)
@
property
@
property
...
...
This diff is collapsed.
Click to expand it.
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