Skip to content

Commit f696c50

Browse files
committed
fix a typo in cookie
1 parent 1e28e5a commit f696c50

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

net/http/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Client : public Object {
174174
std::vector<IPAddr> m_bind_ips;
175175
};
176176

177-
//A Client without cookie_jar would ignore all response-header "Set-Cookies"
177+
//A Client without cookie_jar would ignore all response-header "Set-Cookie"
178178
Client* new_http_client(ICookieJar *cookie_jar = nullptr, TLSContext *tls_ctx = nullptr);
179179

180180
ICookieJar* new_simple_cookie_jar();

net/http/cookie_jar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class SimpleCookie {
5555
public:
5656
unordered_map_string_key<SimpleValue> m_kv;
5757
int get_cookies_from_headers(Message* message) {
58-
auto it = message->headers.find("Set-Cookies");
59-
while (it != message->headers.end() && it.first() == "Set-Cookies") {
58+
auto it = message->headers.find("Set-Cookie");
59+
while (it != message->headers.end() && it.first() == "Set-Cookie") {
6060
LOG_INFO("get cookie");
6161
auto Cookies = it.second();
6262
Parser p(Cookies);

net/http/test/cookie_jar_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ResponseHeaderAdaptor : public Response {
4949
};
5050

5151
ResponseHeaderAdaptor* new_resp(std::string text) {
52-
text = "HTTP/1.1 200 ok\r\nSet-Cookies: " + text + "\r\n\r\n";
52+
text = "HTTP/1.1 200 ok\r\nSet-Cookie: " + text + "\r\n\r\n";
5353
ResponseHeaderAdaptor *ret = new ResponseHeaderAdaptor();
5454
memcpy(ret->m_buf, text.data(), text.size());
5555
ret->append_bytes(text.size());

0 commit comments

Comments
 (0)