Class: AuthHMAC::CanonicalString
- Inherits:
-
String
- Object
- String
- AuthHMAC::CanonicalString
- Includes:
- Headers
- Defined in:
- lib/auth-hmac.rb
Overview
Build a Canonical String for a HTTP request.
A Canonical String has the following format:
CanonicalString = HTTP-Verb + “n” +
Content-Type + "\n" +
Content-MD5 + "\n" +
Date + "\n" +
request-uri;
If the Date header doesn’t exist, one will be generated since Net/HTTP will generate one if it doesn’t exist and it will be used on the server side to do authentication.
Instance Method Summary collapse
-
#initialize(request, authenticate_referrer = false) ⇒ CanonicalString
constructor
A new instance of CanonicalString.
Methods included from Headers
Constructor Details
#initialize(request, authenticate_referrer = false) ⇒ CanonicalString
Returns a new instance of CanonicalString.
76 77 78 79 80 |
# File 'lib/auth-hmac.rb', line 76 def initialize(request, authenticate_referrer=false) self << request_method(request) + "\n" self << header_values(request) + "\n" self << request_path(request, authenticate_referrer) end |