| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -446,7 +446,14 @@ void HTTPConnection::loop() { | |||
| 446 | 446 | } | |
| 447 | 447 | ||
| 448 | 448 | // Create request context | |
| 449 | - HTTPRequest req = HTTPRequest(this, _httpHeaders, resolvedResource.getMatchingNode(), resolvedResource.getParams(), _httpResource); | ||
| 449 | + HTTPRequest req = HTTPRequest( | ||
| 450 | + this, | ||
| 451 | + _httpHeaders, | ||
| 452 | + resolvedResource.getMatchingNode(), | ||
| 453 | + _httpMethod, | ||
| 454 | + resolvedResource.getParams(), | ||
| 455 | + _httpResource | ||
| 456 | + ); | ||
| 450 | 457 | HTTPResponse res = HTTPResponse(this); | |
| 451 | 458 | ||
| 452 | 459 | // Add default headers to the response | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,11 +6,13 @@ HTTPRequest::HTTPRequest( | |||
| 6 | 6 | ConnectionContext * con, | |
| 7 | 7 | HTTPHeaders * headers, | |
| 8 | 8 | HTTPNode * resolvedNode, | |
| 9 | + std::string method, | ||
| 9 | 10 | ResourceParameters * params, | |
| 10 | 11 | std::string requestString): | |
| 11 | 12 | _con(con), | |
| 12 | 13 | _headers(headers), | |
| 13 | 14 | _resolvedNode(resolvedNode), | |
| 15 | + _method(method), | ||
| 14 | 16 | _params(params), | |
| 15 | 17 | _requestString(requestString) { | |
| 16 | 18 | ||
@@ -83,7 +85,7 @@ std::string HTTPRequest::getRequestString() { | |||
| 83 | 85 | } | |
| 84 | 86 | ||
| 85 | 87 | std::string HTTPRequest::getMethod() { | |
| 86 | - return _resolvedNode->getMethod(); | ||
| 88 | + return _method; | ||
| 87 | 89 | } | |
| 88 | 90 | ||
| 89 | 91 | std::string HTTPRequest::getTag() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ namespace httpsserver { | |||
| 17 | 17 | ||
| 18 | 18 | class HTTPRequest { | |
| 19 | 19 | public: | |
| 20 | - HTTPRequest(ConnectionContext * con, HTTPHeaders * headers, HTTPNode * resolvedNode, ResourceParameters * params, std::string requestString); | ||
| 20 | + HTTPRequest(ConnectionContext * con, HTTPHeaders * headers, HTTPNode * resolvedNode, std::string method, ResourceParameters * params, std::string requestString); | ||
| 21 | 21 | virtual ~HTTPRequest(); | |
| 22 | 22 | ||
| 23 | 23 | std::string getHeader(std::string name); | |
@@ -47,6 +47,8 @@ class HTTPRequest { | |||
| 47 | 47 | ||
| 48 | 48 | HTTPNode * _resolvedNode; | |
| 49 | 49 | ||
| 50 | + std::string _method; | ||
| 51 | + | ||
| 50 | 52 | ResourceParameters * _params; | |
| 51 | 53 | ||
| 52 | 54 | std::string _requestString; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments