diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-01-06 13:18:07 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-01-06 13:18:07 +0000 |
commit | 07c938a4c7ffcc7049ee4139dce736d672ad030c (patch) | |
tree | 3766a85a4fee6a064e6d31126dcd5afe89ccadd6 /lib/httpserver/HTTPRequest.h | |
parent | e940d90c18ac768e47e563f223234af777fd70f4 (diff) |
Add Amazon S3 signature checking to simulator.
Diffstat (limited to 'lib/httpserver/HTTPRequest.h')
-rw-r--r-- | lib/httpserver/HTTPRequest.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/httpserver/HTTPRequest.h b/lib/httpserver/HTTPRequest.h index 58874092..90215751 100644 --- a/lib/httpserver/HTTPRequest.h +++ b/lib/httpserver/HTTPRequest.h @@ -86,7 +86,7 @@ public: mHostName = rHostName; } - const int GetHostPort() const {return mHostPort;} // into host name and port number + const int GetHostPort() const {return mHostPort;} const std::string &GetQueryString() const {return mQueryString;} int GetHTTPVersion() const {return mHTTPVersion;} const Query_t &GetQuery() const {return mQuery;} @@ -109,6 +109,7 @@ public: } return false; } + std::vector<Header> GetHeaders() { return mExtraHeaders; } // -------------------------------------------------------------------------- // @@ -130,6 +131,23 @@ public: mExtraHeaders.push_back(Header(rName, rValue)); } bool IsExpectingContinue() const { return mExpectContinue; } + const char* GetVerb() const + { + if (!mHttpVerb.empty()) + { + return mHttpVerb.c_str(); + } + switch (mMethod) + { + case Method_UNINITIALISED: return "Uninitialized"; + case Method_UNKNOWN: return "Unknown"; + case Method_GET: return "GET"; + case Method_HEAD: return "HEAD"; + case Method_POST: return "POST"; + case Method_PUT: return "PUT"; + } + return "Bad"; + } private: void ParseHeaders(IOStreamGetLine &rGetLine, int Timeout); @@ -149,6 +167,7 @@ private: std::vector<Header> mExtraHeaders; bool mExpectContinue; IOStream* mpStreamToReadFrom; + std::string mHttpVerb; }; #endif // HTTPREQUEST__H |