summaryrefslogtreecommitdiff
path: root/src/HttpRequest.cpp
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-07-07 13:47:27 -0600
committercflip <cflip@cflip.net>2022-07-07 13:47:27 -0600
commit280c39bc4d1aa948136e7c3631326e71b2dd1871 (patch)
treed69f0941c07e6419045ab33a346e73c7b6ce5b8c /src/HttpRequest.cpp
parent76337013af1a0dfa8c5da79dd0f008166000001d (diff)
Implement simple URI parsing for multiple pages
Diffstat (limited to 'src/HttpRequest.cpp')
-rw-r--r--src/HttpRequest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/HttpRequest.cpp b/src/HttpRequest.cpp
index 351c971..27a5ce5 100644
--- a/src/HttpRequest.cpp
+++ b/src/HttpRequest.cpp
@@ -10,6 +10,11 @@ HttpRequest::HttpRequest(const std::string& request_string)
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;