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
11b770b3
Commit
11b770b3
authored
Mar 03, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #830
Fix user with umlauts
parent
fa276fd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
osd.xml
cps/templates/osd.xml
+1
-1
web.py
cps/web.py
+4
-1
No files found.
cps/templates/osd.xml
View file @
11b770b3
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<Developer>
Janeczku
</Developer>
<Developer>
Janeczku
</Developer>
<Contact>
https://github.com/janeczku/calibre-web
</Contact>
<Contact>
https://github.com/janeczku/calibre-web
</Contact>
<Url
type=
"text/html"
<Url
type=
"text/html"
template=
"{{url_for('
search')}}?query=
{searchTerms}"
/>
template=
"{{url_for('
feed_cc_search')}}
{searchTerms}"
/>
<Url
type=
"application/atom+xml"
<Url
type=
"application/atom+xml"
template=
"{{url_for('feed_normal_search')}}?query={searchTerms}"
/>
template=
"{{url_for('feed_normal_search')}}?query={searchTerms}"
/>
<SyndicationRight>
open
</SyndicationRight>
<SyndicationRight>
open
</SyndicationRight>
...
...
cps/web.py
View file @
11b770b3
...
@@ -247,7 +247,7 @@ def load_user_from_header(header_val):
...
@@ -247,7 +247,7 @@ def load_user_from_header(header_val):
header_val
=
header_val
.
replace
(
'Basic '
,
''
,
1
)
header_val
=
header_val
.
replace
(
'Basic '
,
''
,
1
)
basic_username
=
basic_password
=
''
basic_username
=
basic_password
=
''
try
:
try
:
header_val
=
base64
.
b64decode
(
header_val
)
header_val
=
base64
.
b64decode
(
header_val
)
.
decode
(
'utf-8'
)
basic_username
=
header_val
.
split
(
':'
)[
0
]
basic_username
=
header_val
.
split
(
':'
)[
0
]
basic_password
=
header_val
.
split
(
':'
)[
1
]
basic_password
=
header_val
.
split
(
':'
)[
1
]
except
TypeError
:
except
TypeError
:
...
@@ -259,6 +259,8 @@ def load_user_from_header(header_val):
...
@@ -259,6 +259,8 @@ def load_user_from_header(header_val):
def
check_auth
(
username
,
password
):
def
check_auth
(
username
,
password
):
if
sys
.
version_info
.
major
==
3
:
username
=
username
.
encode
(
'windows-1252'
)
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
func
.
lower
(
ub
.
User
.
nickname
)
==
username
.
lower
())
.
first
()
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
func
.
lower
(
ub
.
User
.
nickname
)
==
username
.
lower
())
.
first
()
return
bool
(
user
and
check_password_hash
(
user
.
password
,
password
))
return
bool
(
user
and
check_password_hash
(
user
.
password
,
password
))
...
@@ -726,6 +728,7 @@ def feed_osd():
...
@@ -726,6 +728,7 @@ def feed_osd():
return
render_xml_template
(
'osd.xml'
,
lang
=
'en-EN'
)
return
render_xml_template
(
'osd.xml'
,
lang
=
'en-EN'
)
@
app
.
route
(
"/opds/search/"
,
defaults
=
{
'query'
:
""
})
@
app
.
route
(
"/opds/search/<query>"
)
@
app
.
route
(
"/opds/search/<query>"
)
@
requires_basic_auth_if_no_ano
@
requires_basic_auth_if_no_ano
def
feed_cc_search
(
query
):
def
feed_cc_search
(
query
):
...
...
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