cut off port from the domain when needed.

This commit is contained in:
Joris Vink 2018-04-24 20:11:13 +02:00
parent 98af796acd
commit 5487950f63
1 changed files with 4 additions and 0 deletions

View File

@ -872,6 +872,7 @@ http_response_cookie(struct http_request *req, const char *name,
const char *val, const char *path, time_t expires, u_int32_t maxage,
struct http_cookie **out)
{
char *p;
struct http_cookie *ck;
if (name == NULL || val == NULL)
@ -886,6 +887,9 @@ http_response_cookie(struct http_request *req, const char *name,
ck->domain = kore_strdup(req->host);
ck->flags = HTTP_COOKIE_HTTPONLY | HTTP_COOKIE_SECURE;
if ((p = strrchr(ck->domain, ':')) != NULL)
*p = '\0';
if (path != NULL)
ck->path = kore_strdup(path);
else