mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-22 23:24:07 +01:00
Joyent hasn't upgraded their gem yet, and for many users this could be a major installation pitfall. Rails is vendored, so why can't it boot? Rack? What's that?
40 lines
812 B
Ruby
40 lines
812 B
Ruby
require 'rack/auth/abstract/request'
|
|
require 'rack/auth/digest/params'
|
|
require 'rack/auth/digest/nonce'
|
|
|
|
module Rack
|
|
module Auth
|
|
module Digest
|
|
class Request < Auth::AbstractRequest
|
|
|
|
def method
|
|
@env['rack.methodoverride.original_method'] || @env['REQUEST_METHOD']
|
|
end
|
|
|
|
def digest?
|
|
:digest == scheme
|
|
end
|
|
|
|
def correct_uri?
|
|
(@env['SCRIPT_NAME'].to_s + @env['PATH_INFO'].to_s) == uri
|
|
end
|
|
|
|
def nonce
|
|
@nonce ||= Nonce.parse(params['nonce'])
|
|
end
|
|
|
|
def params
|
|
@params ||= Params.parse(parts.last)
|
|
end
|
|
|
|
def method_missing(sym)
|
|
if params.has_key? key = sym.to_s
|
|
return params[key]
|
|
end
|
|
super
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|