From c2111c6f4aa30d442a95bbf27b20b86fe65ab1c0 Mon Sep 17 00:00:00 2001 From: molhot Date: Sun, 3 Sep 2023 21:30:57 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E5=89=8D=E3=81=AB=E6=9C=A8=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=A8=E3=81=97=E3=81=A6=E8=AA=8D=E3=82=81?= =?UTF-8?q?=E3=82=89=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=81=8B=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AA=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8C=E3=81=B0?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E3=80=81=E9=95=B7=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/HttpRequest/HttpRequest.cpp | 38 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) 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); }