Skip to content

Commit

Permalink
事前に木ワードとして認められているか判定するような関数を作成すれば完成、長かった
Browse files Browse the repository at this point in the history
  • Loading branch information
molhot committed Sep 3, 2023
1 parent 0fc4efa commit c2111c6
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions srcs/HttpRequest/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> httprequest_keyset
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit c2111c6

Please sign in to comment.