Skip to content

Commit

Permalink
add support for Sinatra 4
Browse files Browse the repository at this point in the history
  • Loading branch information
beanieboi committed Feb 13, 2024
1 parent 28adde0 commit e26a427
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
ruby-version: ['3.0', '3.1', '3.2']
activesupport-version: ['6', '7']
sinatra-version: ['2', '3']
sinatra-version: ['2', '3', '4']
env:
ACTIVESUPPORT_MAJOR: ${{ matrix.activesupport-version }}
SINATRA_MAJOR: ${{ matrix.sinatra-version }}
Expand Down
12 changes: 6 additions & 6 deletions lib/pliny/middleware/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def allow_headers

def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => allow_headers.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
'access-control-allow-origin' => env["HTTP_ORIGIN"],
'access-control-allow-methods' => ALLOW_METHODS.join(', '),
'access-control-allow-headers' => allow_headers.join(', '),
'access-control-allow-credentials' => "true",
'access-control-max-age' => "1728000",
'access-control-expose-headers' => EXPOSE_HEADERS.join(', ')
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pliny/middleware/versioning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def detect_api_version(env)
error = { id: :bad_version, message: <<-eos }
Please specify a version along with the MIME type. For example, `Accept: application/vnd.#{@app_name}+json; version=1`.
eos
return [400, { "Content-Type" => "application/json; charset=utf-8" },
return [400, { "content-type" => "application/json; charset=utf-8" },
[MultiJson.encode(error)]]
end

Expand Down
6 changes: 3 additions & 3 deletions pliny.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Gem::Specification.new do |gem|
gem.add_dependency "prmd", "~> 0.11", ">= 0.11.4"


gem.add_dependency "sinatra", ">= 2.0", "< 4.0"
gem.add_dependency "sinatra", ">= 2.0", "< 5.0"
gem.add_dependency "http_accept", "~> 0.1", ">= 0.1.5"
gem.add_dependency "sinatra-router", "~> 0.2", ">= 0.2.4"
gem.add_dependency "thor", ">= 0.19", "< 2.0"

gem.add_development_dependency "rake", "~> 13.0"
gem.add_development_dependency "rack-test", "~> 1.1.0"
gem.add_development_dependency "rack-test", "~> 2"
gem.add_development_dependency "rspec", "~> 3.1", ">= 3.1.0"
gem.add_development_dependency "sinatra-contrib", ">= 2.0", "< 4.0"
gem.add_development_dependency "sinatra-contrib", ">= 2.0", "< 5.0"
gem.add_development_dependency "timecop", "~> 0.7", ">= 0.7.1"
gem.add_development_dependency "pry"
gem.add_development_dependency "pry-byebug"
Expand Down

0 comments on commit e26a427

Please sign in to comment.