summaryrefslogtreecommitdiff
path: root/src/HttpRequest.cpp
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-05-08 21:25:21 -0600
committercflip <cflip@cflip.net>2023-05-08 21:25:21 -0600
commit7f1d6bbc335288df1e24e7c8f305c32afe6b050a (patch)
tree3ca1784ab73315e44dd9e03b2f0e244a59158fbc /src/HttpRequest.cpp
parent83fb0b96c94e7f596f81d5bc346150904457ed64 (diff)
Begin rewriting cfws in C
Diffstat (limited to 'src/HttpRequest.cpp')
-rw-r--r--src/HttpRequest.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/HttpRequest.cpp b/src/HttpRequest.cpp
deleted file mode 100644
index 37c85fd..0000000
--- a/src/HttpRequest.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "HttpRequest.h"
-
-#include <iostream>
-
-HttpRequest::HttpRequest(const std::string& request_string)
-{
- size_t pos = 0;
- std::string s = request_string;
- std::string line;
- while ((pos = s.find("\r\n")) != std::string::npos) {
- line = s.substr(0, pos);
-
- if (line.find("GET ") != std::string::npos) {
- m_uri = s.substr(4, line.find(' ', 5) - 4);
- std::cout << m_uri << std::endl;
- }
-
- // If the line contains a colon, we assume it's a header.
- // TODO: This may not always be the case.
- size_t delim_pos = 0;
- if ((delim_pos = line.find(':')) != std::string::npos) {
- std::string header_key = s.substr(0, delim_pos);
- std::string header_value = s.substr(delim_pos + 2, s.find("\r\n") - delim_pos - 2);
- m_headers[header_key] = header_value;
- }
- s.erase(0, pos + 2);
- }
-}