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
6855dece
Commit
6855dece
authored
Oct 01, 2017
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added corresponding content-type for a downloaded book, otherwise default text/html is used
parent
0f0c6dde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
web.py
cps/web.py
+5
-1
No files found.
cps/web.py
View file @
6855dece
...
@@ -874,7 +874,11 @@ def get_opds_download_link(book_id, book_format):
...
@@ -874,7 +874,11 @@ def get_opds_download_link(book_id, book_format):
file_name
=
helper
.
get_valid_filename
(
file_name
)
file_name
=
helper
.
get_valid_filename
(
file_name
)
headers
=
Headers
()
headers
=
Headers
()
headers
[
"Content-Disposition"
]
=
"attachment; filename*=UTF-8''
%
s.
%
s"
%
(
quote
(
file_name
.
encode
(
'utf8'
)),
book_format
)
headers
[
"Content-Disposition"
]
=
"attachment; filename*=UTF-8''
%
s.
%
s"
%
(
quote
(
file_name
.
encode
(
'utf8'
)),
book_format
)
app
.
logger
.
info
(
time
.
time
()
-
startTime
)
try
:
headers
[
"Content-Type"
]
=
mimetypes
.
types_map
[
'.'
+
book_format
]
except
KeyError
:
headers
[
"Content-Type"
]
=
"application/octet-stream"
app
.
logger
.
info
(
time
.
time
()
-
startTime
)
startTime
=
time
.
time
()
startTime
=
time
.
time
()
if
config
.
config_use_google_drive
:
if
config
.
config_use_google_drive
:
app
.
logger
.
info
(
time
.
time
()
-
startTime
)
app
.
logger
.
info
(
time
.
time
()
-
startTime
)
...
...
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