mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
StaticFileHandler: use HTTP::Status rather than integers
This commit is contained in:
parent
d950a0ef5d
commit
5565204273
@ -111,7 +111,7 @@ module Kemal
|
|||||||
if @fallthrough
|
if @fallthrough
|
||||||
call_next(context)
|
call_next(context)
|
||||||
else
|
else
|
||||||
context.response.status_code = 405
|
context.response.status = HTTP::Status::METHOD_NOT_ALLOWED
|
||||||
context.response.headers.add("Allow", "GET, HEAD")
|
context.response.headers.add("Allow", "GET, HEAD")
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
@ -124,7 +124,7 @@ module Kemal
|
|||||||
# File path cannot contains '\0' (NUL) because all filesystem I know
|
# File path cannot contains '\0' (NUL) because all filesystem I know
|
||||||
# don't accept '\0' character as file name.
|
# don't accept '\0' character as file name.
|
||||||
if request_path.includes? '\0'
|
if request_path.includes? '\0'
|
||||||
context.response.status_code = 400
|
context.response.status = HTTP::Status::BAD_REQUEST
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ module Kemal
|
|||||||
add_cache_headers(context.response.headers, last_modified)
|
add_cache_headers(context.response.headers, last_modified)
|
||||||
|
|
||||||
if cache_request?(context, last_modified)
|
if cache_request?(context, last_modified)
|
||||||
context.response.status_code = 304
|
context.response.status = HTTP::Status::NOT_MODIFIED
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ module Kemal
|
|||||||
add_cache_headers(context.response.headers, last_modified)
|
add_cache_headers(context.response.headers, last_modified)
|
||||||
|
|
||||||
if cache_request?(context, last_modified)
|
if cache_request?(context, last_modified)
|
||||||
context.response.status_code = 304
|
context.response.status = HTTP::Status::NOT_MODIFIED
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user