Skip to content

Commit

Permalink
optimize cookie handling in request
Browse files Browse the repository at this point in the history
Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
  • Loading branch information
nnnkkk7 committed Jan 8, 2024
1 parent 7830aae commit f2796fd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frankenphp.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,14 +672,13 @@ func go_read_cookies(rh C.uintptr_t) *C.char {
if len(cookies) == 0 {
return nil
}

cookieString := make([]string, len(cookies))
for _, cookie := range r.Cookies() {
cookieString = append(cookieString, cookie.String())
cookieStrings := make([]string, len(cookies))
for i, cookie := range cookies {
cookieStrings[i] = cookie.String()
}

// freed in frankenphp_request_shutdown()
return C.CString(strings.Join(cookieString, "; "))
return C.CString(strings.Join(cookieStrings, "; "))
}

//export go_log
Expand Down

0 comments on commit f2796fd

Please sign in to comment.