Open ethancn opened 1 year ago
For anyone who has the same question, here's the solution: to add repeating headers, just append spaces to the name as many as you need, like below
headers['Set-Cookie'] = "name1=new-val1";
headers['Set-Cookie '] = "name2=new-val2";
headers['Set-Cookie '] = "name3=new-val3";
Quantumult X will turn them into multiple Set-Cookie
headers in response.
So I'm using a script to rewrite response headers (
script-response-header
). When the server responds with multipleSet-Cookie
headers, the script value$response.headers['Set-Cookie']
seems automatically concatenated, for example:Response headers:
$response.headers['Set-Cookie']
value:This will cause a problem even if I just copy the headers and set them back:
The resulting header is incorrect:
What I want to do is modify the
Set-Cookie
response headers with new values, like below:But currently I‘ve found no way to set multiple
Set-Cookie
headers using script. I have tried an array and it didn't seem to work either (version 1.3.0):