chore: improve appwrite maintenance path#12535
Conversation
Greptile SummaryThis PR hardens two k6 benchmark helpers:
Confidence Score: 3/5The WebSocket change is safe, but the cookie-joining logic in http.js will produce malformed Cookie request headers that may cause authenticated benchmark flows to fail silently. The cookieHeader function joins full Set-Cookie response header values including attributes like Path=/ and HttpOnly directly into the Cookie request header, which can break session-based authentication flows in the benchmark. The ws.js change is well-constructed and has no issues. tests/benchmarks/http.js — the cookieHeader array-join logic needs attention Important Files Changed
Reviews (1): Last reviewed commit: "chore: improve appwrite maintenance path" | Re-trigger Greptile |
| if (Array.isArray(cookie)) { | ||
| return cookie.join('; '); | ||
| } |
There was a problem hiding this comment.
When multiple
Set-Cookie response headers are joined with '; ', each value typically includes cookie attributes (e.g. session=abc; Path=/; HttpOnly). Joining them produces a malformed Cookie request header where attribute names like Path and HttpOnly get parsed as cookie names by the server. The correct approach is to extract only the name=value portion (everything before the first ;) from each Set-Cookie entry before joining.
| if (Array.isArray(cookie)) { | |
| return cookie.join('; '); | |
| } | |
| if (Array.isArray(cookie)) { | |
| return cookie.map(c => c.split(';')[0].trim()).join('; '); | |
| } |
Summary:
Notes: