diff --git a/srcs/HttpRequest/HttpRequest.cpp b/srcs/HttpRequest/HttpRequest.cpp index 9339cf21..98911316 100644 --- a/srcs/HttpRequest/HttpRequest.cpp +++ b/srcs/HttpRequest/HttpRequest.cpp @@ -82,28 +82,29 @@ ValueWeightArraySet* HttpRequest::ready_ValueWeightArraySet(const std::string &v else value_map[line] = 1.0; } - return (new ValueWeightArraySet(value_map));//適当に作ってる + return (new ValueWeightArraySet(value_map)); } bool HttpRequest::check_keyword_exist(const std::string &key) { - const std::string httprequest_keyset_arr[] = { - "Host", - "Connection", - "Referer", "Content-Type", "Range", "Upgrade", "Accept-Encoding", "Via", "Keep-Alive", "Accept-Language", "Accept", "Date", - "Cookie", - "If-Modified-Since", "If-Unmodified-Since","If-Match","If-None-Match","Content-Length","Content-Range","If-Range","Transfer-Encoding", - "Expect","Authorization","User-Agent", - - "Accept-CH", "Accept-Charset", "Accept-Patch", "Accept-Ranges", "Access-Control-Allow-Credentials", - "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", - "Access-Control-Request-Headers", "Access-Control-Request-Method", "Age", "Allow", "Alt-Svc", "Cache-Control", "Clear-Site-Data", - "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Location", "Content-Security-Policy", - "Content-Security-Policy-Report-Only", "Cross-Origin-Embedder-Policy", "Cross-Origin-Opener-Policy", "Cross-Origin-Resource-Policy", - "ETag", "Expect-CT", "Expires", "Forwarded", "From", - "Last-Modified", "Location", "Origin", "Permissions-Policy", "Proxy-Authenticate", "Proxy-Authorization", "Referrer-Policy", - "Retry-After", "Server", "Server-Timing", "Set-Cookie", "SourceMap", "Timing-Allow-Origin", - "Upgrade-Insecure-Requests", "Vary", "WWW-Authenticate" + const std::string httprequest_keyset_arr[] = + { + "Host", + "Connection", + "Referer", "Content-Type", "Range", "Upgrade", "Accept-Encoding", "Via", "Keep-Alive", "Accept-Language", "Accept", "Date", + "Cookie", + "If-Modified-Since", "If-Unmodified-Since","If-Match","If-None-Match","Content-Length","Content-Range","If-Range","Transfer-Encoding", + "Expect","Authorization","User-Agent", + + "Accept-CH", "Accept-Charset", "Accept-Patch", "Accept-Ranges", "Access-Control-Allow-Credentials", + "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", + "Access-Control-Request-Headers", "Access-Control-Request-Method", "Age", "Allow", "Alt-Svc", "Cache-Control", "Clear-Site-Data", + "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Location", "Content-Security-Policy", + "Content-Security-Policy-Report-Only", "Cross-Origin-Embedder-Policy", "Cross-Origin-Opener-Policy", "Cross-Origin-Resource-Policy", + "ETag", "Expect-CT", "Expires", "Forwarded", "From", + "Last-Modified", "Location", "Origin", "Permissions-Policy", "Proxy-Authenticate", "Proxy-Authorization", "Referrer-Policy", + "Retry-After", "Server", "Server-Timing", "Set-Cookie", "SourceMap", "Timing-Allow-Origin", + "Upgrade-Insecure-Requests", "Vary", "WWW-Authenticate" }; const std::set httprequest_keyset @@ -138,6 +139,7 @@ std::string HttpRequest::obtain_request_value(const std::string value) void HttpRequest::set_accept(const std::string &key, const std::string &value) { + //どんなリクエストも受け付ける模様? this->request_keyvalue_map[key] = ready_ValueWeightArraySet(value); }