Created
April 12, 2020 00:43
-
-
Save shouc/a9330df817128bc4c4132abf3de09495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cpp-httplib/httplib.h" | |
using namespace httplib; | |
int main() { | |
Server svr; | |
svr.Get("/1", [](const Request& req, Response& res) { | |
res.set_redirect("1\r\nSet-Cookie: a=1"); | |
}); | |
svr.Get("/2", [](const Request& req, Response& res) { | |
res.set_header("a", "1\r\nSet-Cookie: a=1"); | |
}); | |
svr.listen("localhost", 3000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK. Thanks for the info.