diff options
| author | agri <[email protected]> | 2022-02-10 16:48:12 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:12 +0300 | 
| commit | d3530b2692e400bd4d29bd4f07cafaee139164e7 (patch) | |
| tree | b7ae636a74490e649a2ed0fdd5361f1bec83b9f9 /library/cpp/http/server/http_ex.cpp | |
| parent | 0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/server/http_ex.cpp')
| -rw-r--r-- | library/cpp/http/server/http_ex.cpp | 52 | 
1 files changed, 26 insertions, 26 deletions
| diff --git a/library/cpp/http/server/http_ex.cpp b/library/cpp/http/server/http_ex.cpp index e07db22bfc8..7fb63784826 100644 --- a/library/cpp/http/server/http_ex.cpp +++ b/library/cpp/http/server/http_ex.cpp @@ -27,45 +27,45 @@ bool THttpClientRequestExtension::ProcessHeaders(TBaseServerRequestData& rd, TBl      char* s = RequestString.begin(); -    enum EMethod { -        NotImplemented, -        Get, -        Post, -        Put, +    enum EMethod {  +        NotImplemented,  +        Get,  +        Post,  +        Put,           Patch,          Delete, -    }; - -    enum EMethod foundMethod; -    char* urlStart; - +    };  +  +    enum EMethod foundMethod;  +    char* urlStart;  +       if (strnicmp(s, "GET ", 4) == 0) { -        foundMethod = Get; -        urlStart = s + 4; -    } else if (strnicmp(s, "POST ", 5) == 0) { -        foundMethod = Post; -        urlStart = s + 5; -    } else if (strnicmp(s, "PUT ", 4) == 0) { -        foundMethod = Put; -        urlStart = s + 4; +        foundMethod = Get;  +        urlStart = s + 4;  +    } else if (strnicmp(s, "POST ", 5) == 0) {  +        foundMethod = Post;  +        urlStart = s + 5;  +    } else if (strnicmp(s, "PUT ", 4) == 0) {  +        foundMethod = Put;  +        urlStart = s + 4;       } else if (strnicmp(s, "PATCH ", 6) == 0) {          foundMethod = Patch;          urlStart = s + 6;      } else if (strnicmp(s, "DELETE ", 7) == 0) {          foundMethod = Delete;          urlStart = s + 7; -    } else { -        foundMethod = NotImplemented; -    } - -    switch (foundMethod) { +    } else {  +        foundMethod = NotImplemented;  +    }  +  +    switch (foundMethod) {           case Get:          case Delete:              if (!Parse(urlStart, rd)) {                  return false;              }              break; - +           case Post:          case Put:          case Patch: @@ -91,8 +91,8 @@ bool THttpClientRequestExtension::ProcessHeaders(TBaseServerRequestData& rd, TBl              } catch (...) {                  Output() << "HTTP/1.1 400 Bad request\r\n\r\n";                  return false; -            } - +            }  +               if (!Parse(urlStart, rd)) {                  return false;              } | 
