14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/coin_rack.rb', line 14
def call(env)
begin
request = Rack::Request.new(env)
request.POST.cast_values!
return favicon if request.path == "/favicon.ico"
return get(request) if request.get?
return post(request) if request.post?
return put(request) if request.put?
return delete(request) if request.delete?
rescue Exception => ex
[500, {"Content-Type" => "text/html"}, ["ERROR: #{ex}"]]
end
[400, {"Content-Type" => "text/html"}, ["BAD REQUEST"]]
end
|