rickardandersson / rubric

Browser extension for injecting custom request and response headers.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Append a value (Cookie Header) #2

Open swiffer opened 9 months ago

swiffer commented 9 months ago

It would be great to be able to append a value within a header (Cookie / XDEBUG_SESSION) instead of replacing the header value.

https://xdebug.org/docs/step_debug#cookie-init

rickardandersson commented 9 months ago

Apologies for not responding until now. I must have forgotten to update my notification settings for this repo.

I'm afraid declarativeNetRequest that Rubric uses to add rules does not support appending to an existing header value. It does support the append operation, but I'm not entirely sure what that does. I believe it just adds a second header. There's also an allowlist of a particular set of headers where the append operation is allowed, so it'll be tricky to do the UI for this.

Here's the list of request headers that Chrome supports appending to:

{"accept", ", "}, {"accept-encoding", ", "}, {"accept-language", ", "}, {"access-control-request-headers", ", "}, {"cache-control", ", "}, {"connection", ", "}, {"content-language", ", "}, {"cookie", "; "}, {"forwarded", ", "}, {"if-match", ", "}, {"if-none-match", ", "}, {"keep-alive", ", "}, {"range", ", "}, {"te", ", "}, {"trailer", ""}, {"transfer-encoding", ", "}, {"upgrade", ", "}, {"user-agent", " "}, {"via", ", "}, {"want-digest", ", "}, {"x-forwarded-for", ", "}