mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-10 22:43:52 +00:00
Black reformat.
This commit is contained in:
parent
5632e82e13
commit
8c8e24a3b9
@ -117,9 +117,9 @@ def _authorization_decorator(required_secrets):
|
|||||||
try:
|
try:
|
||||||
# Check Authorization header:
|
# Check Authorization header:
|
||||||
if not timing_safe_compare(
|
if not timing_safe_compare(
|
||||||
request.requestHeaders.getRawHeaders("Authorization", [""])[0].encode(
|
request.requestHeaders.getRawHeaders("Authorization", [""])[
|
||||||
"utf-8"
|
0
|
||||||
),
|
].encode("utf-8"),
|
||||||
swissnum_auth_header(self._swissnum),
|
swissnum_auth_header(self._swissnum),
|
||||||
):
|
):
|
||||||
raise _HTTPError(http.UNAUTHORIZED)
|
raise _HTTPError(http.UNAUTHORIZED)
|
||||||
@ -494,6 +494,7 @@ def read_range(
|
|||||||
|
|
||||||
def _add_error_handling(app: Klein):
|
def _add_error_handling(app: Klein):
|
||||||
"""Add exception handlers to a Klein app."""
|
"""Add exception handlers to a Klein app."""
|
||||||
|
|
||||||
@app.handle_errors(_HTTPError)
|
@app.handle_errors(_HTTPError)
|
||||||
def _http_error(_, request, failure):
|
def _http_error(_, request, failure):
|
||||||
"""Handle ``_HTTPError`` exceptions."""
|
"""Handle ``_HTTPError`` exceptions."""
|
||||||
@ -885,7 +886,7 @@ class HTTPServer(object):
|
|||||||
def read_mutable_chunk(self, request, authorization, storage_index, share_number):
|
def read_mutable_chunk(self, request, authorization, storage_index, share_number):
|
||||||
"""Read a chunk from a mutable."""
|
"""Read a chunk from a mutable."""
|
||||||
request.setHeader("content-type", "application/octet-stream")
|
request.setHeader("content-type", "application/octet-stream")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
share_length = self._storage_server.get_mutable_share_length(
|
share_length = self._storage_server.get_mutable_share_length(
|
||||||
storage_index, share_number
|
storage_index, share_number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user