Updated and working.
This commit is contained in:
1 parent
d4148b0ab4
commit
a37c4e6829
30 files changed
+422
-226
No files matched your search
@@ -0,0 +1,17 @@
|
||||
GET / HTTP/1.1
|
||||
Host: localhost:8080
|
||||
Connection: keep-alive
|
||||
Cache-Control: max-age=0
|
||||
sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
|
||||
sec-ch-ua-mobile: ?0
|
||||
Upgrade-Insecure-Requests: 1
|
||||
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
|
||||
Sec-Fetch-Site: none
|
||||
Sec-Fetch-Mode: navigate
|
||||
Sec-Fetch-User: ?1
|
||||
Sec-Fetch-Dest: document
|
||||
Accept-Encoding: gzip, deflate, br
|
||||
Accept-Language: en-US,en;q=0.9,fr-CA;q=0.8,fr;q=0.7
|
||||
Cookie: _ga=GA1.1.1017526412.1628195401
|
||||
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
#include <iostream>
|
||||
#include "../IMFMessage.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
coreutils::ZString buffer("Host: localhost:8080\r\n"
|
||||
"Connection: keep-alive\r\n"
|
||||
"Cache-Control: max-age=0\r\n"
|
||||
"sec-ch-ua: \"Chromium\";v=\"92\", \" Not A;Brand\";v=\"99\", \"Google Chrome\";v=\"92\"\r\n"
|
||||
"sec-ch-ua-mobile: ?0\r\n"
|
||||
"Upgrade-Insecure-Requests: 1\r\n"
|
||||
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0\r\n"
|
||||
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n"
|
||||
"Sec-Fetch-Site: none\r\n"
|
||||
"Sec-Fetch-Mode: navigate\r\n"
|
||||
"Sec-Fetch-User: ?1\r\n"
|
||||
"Sec-Fetch-Dest: document\r\n"
|
||||
"Accept-Encoding: gzip, deflate, br\r\n"
|
||||
"Accept-Language: en-US,en;q=0.9,fr-CA;q=0.8,fr;q=0.7\r\n"
|
||||
"Cookie: _ga=GA1.1.1017526412.1628195401\r\n"
|
||||
"\r\n");
|
||||
|
||||
coreutils::IMFMessage message(buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
@@ -4,14 +4,52 @@
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
coreutils::ZString test("character1111:22222:33333");
|
||||
test.length = 9;
|
||||
std::cout << "test pre-split: [" << test << "]." << std::endl;
|
||||
|
||||
test.split(":");
|
||||
|
||||
std::cout << test << std::endl;
|
||||
std::cout << "test post-split: [" << test << "]." << std::endl;
|
||||
std::cout << "test sections: [" << test.getList().size() << "]." << std::endl;
|
||||
std::cout << test.getLength() << std::endl;
|
||||
|
||||
std::cout << test[0] << std::endl;
|
||||
std::cout << test[1] << std::endl;
|
||||
std::cout << test[2] << std::endl;
|
||||
|
||||
coreutils::ZString test2("character1111:::::22222:::::33333");
|
||||
|
||||
test2.split(":::::");
|
||||
|
||||
std::cout << "test string: [" << test2 << "]" << std::endl;
|
||||
std::cout << "length: [" << test2.getLength() << "]" << std::endl;
|
||||
|
||||
std::cout << "[" << test2[0] << "]" << std::endl;
|
||||
std::cout << "[" << test2[1] << "]" << std::endl;
|
||||
std::cout << "[" << test2[2] << "]" << std::endl;
|
||||
std::cout << "[" << test2[3] << "]" << std::endl;
|
||||
|
||||
coreutils::ZString boundary("----WebKitFormBoundary5hx9ixjfxtJ8nXNm");
|
||||
|
||||
coreutils::ZString test3("------WebKitFormBoundary5hx9ixjfxtJ8nXNm\r\n"
|
||||
"Content-Disposition: form-data; name=\"username\"\r\n"
|
||||
"\r\n"
|
||||
"test\r\n"
|
||||
"------WebKitFormBoundary5hx9ixjfxtJ8nXNm\r\n"
|
||||
"Content-Disposition: form-data; name=\"password\"\r\n"
|
||||
"\r\n"
|
||||
"test\r\n"
|
||||
"------WebKitFormBoundary5hx9ixjfxtJ8nXNm\r\n"
|
||||
"Content-Disposition: form-data; name=\"verify\"\r\n"
|
||||
"\r\n"
|
||||
"test\r\n"
|
||||
"------WebKitFormBoundary5hx9ixjfxtJ8nXNm--\r\n");
|
||||
|
||||
test3.split(boundary);
|
||||
|
||||
std::cout << "[" << test3[0] << "]" << std::endl;
|
||||
std::cout << "[" << test3[1] << "]" << std::endl;
|
||||
std::cout << "[" << test3[2] << "]" << std::endl;
|
||||
std::cout << "[" << test3[3] << "]" << std::endl;
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user