mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Implement parse_url_params
This commit is contained in:
parent
0b4a36953f
commit
3e8b2ae51c
1 changed files with 12 additions and 1 deletions
|
@ -36,7 +36,18 @@ class Kemal::ParamParser
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_url_params
|
def parse_url_params
|
||||||
parse_part(@request.url_params.to_s)
|
url_params = @request.url_params
|
||||||
|
begin
|
||||||
|
url_params = url_params.not_nil!
|
||||||
|
name_table = url_params.regex.name_table
|
||||||
|
size = url_params.size
|
||||||
|
size.times do |i|
|
||||||
|
name = name_table.fetch(i + 1) { i + 1 }
|
||||||
|
value = url_params[i + 1]
|
||||||
|
@params[name as String] = value
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Parses JSON request body if Content-Type is `application/json`.
|
# Parses JSON request body if Content-Type is `application/json`.
|
||||||
|
|
Loading…
Reference in a new issue