Skip to content

Commit 5fdf8ad

Browse files
committed
Use Rack::Requests#params
1 parent f57d7c1 commit 5fdf8ad

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/racknga/api-keys.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
2+
# Copyright (C) 2024 Sutou Kouhei <kou@clear-code.com>
43
#
54
# This library is free software; you can redistribute it and/or
65
# modify it under the terms of the GNU Lesser General Public
@@ -32,7 +31,7 @@ def initialize(query_parameter, api_keys)
3231
# @return [Boolean] true if an API key is included, or false if not.
3332
def include?(environment)
3433
request = Rack::Request.new(environment)
35-
key = request[@query_parameter]
34+
key = request.params[@query_parameter]
3635

3736
@api_keys.include?(key)
3837
end

lib/racknga/middleware/jsonp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def initialize(application)
8282
# For Rack.
8383
def call(environment)
8484
request = Rack::Request.new(environment)
85-
callback = request["callback"]
85+
callback = request.params["callback"]
8686
update_cache_key(request) if callback
8787
status, headers, body = @application.call(environment)
8888
return [status, headers, body] unless callback

0 commit comments

Comments
 (0)