mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Use Ameba on Travis CI (#520)
This commit is contained in:
parent
c646aad482
commit
06665e81bc
5 changed files with 9 additions and 3 deletions
|
@ -7,6 +7,7 @@ script:
|
|||
- crystal spec
|
||||
- crystal spec --release --no-debug
|
||||
- crystal tool format --check
|
||||
- bin/ameba src
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
|
|
|
@ -15,6 +15,11 @@ dependencies:
|
|||
github: crystal-loot/exception_page
|
||||
version: ~> 0.1.1
|
||||
|
||||
development_dependencies:
|
||||
ameba:
|
||||
github: veelenga/ameba
|
||||
version: ~> 0.9.0
|
||||
|
||||
crystal: 0.27.2
|
||||
|
||||
license: MIT
|
||||
|
|
|
@ -14,7 +14,7 @@ module Kemal
|
|||
log("Exception: #{ex.inspect_with_backtrace}")
|
||||
return call_exception_with_status_code(context, ex, 500) if Kemal.config.error_handlers.has_key?(500)
|
||||
verbosity = Kemal.config.env == "production" ? false : true
|
||||
return render_500(context, ex, verbosity)
|
||||
render_500(context, ex, verbosity)
|
||||
end
|
||||
|
||||
private def call_exception_with_status_code(context : HTTP::Server::Context, exception : Exception, status_code : Int32)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class HTTP::Server::Response
|
||||
class Output
|
||||
def close
|
||||
unless response.wrote_headers? && !response.headers.has_key?("Content-Range")
|
||||
if !response.wrote_headers? && response.headers.has_key?("Content-Range")
|
||||
response.content_length = @out_count
|
||||
end
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ module Kemal
|
|||
context.response.content_type = "text/html"
|
||||
directory_listing(context.response, request_path, file_path)
|
||||
else
|
||||
return call_next(context)
|
||||
call_next(context)
|
||||
end
|
||||
elsif File.exists?(file_path)
|
||||
last_modified = modification_time(file_path)
|
||||
|
|
Loading…
Reference in a new issue