cloudflare / lua-resty-cookie

Lua library for HTTP cookie manipulations for OpenResty/ngx_lua
347 stars 160 forks source link

Add edit and parse_set_cookie functionality #35

Closed RulerOf closed 1 year ago

RulerOf commented 4 years ago

Resolves #11

This pull request adds functionality to allow parsing and editing of outgoing Set-Cookie headers.

The parse_set_cookie function is basically the unbake() function requested in #11. It came from nmap, but was edited slightly for compatibility.

BuyerQuest is currently using this code for all production traffic. As you may be able to infer from the example in the README, we developed this to add SameSite cookie flag support to our application.

Given the list of outstanding PRs, I ask that you please confirm interest in merging these changes before I will spend the time to develop a proper test suite for the functionality.

maurizioabba commented 1 year ago

Seeing this now. Assuming fine to close, please reopen if interested

RulerOf commented 1 year ago

Hi @maurizioabba.

Seeing this now. Assuming fine to close, please reopen if interested

This PR does add a significant new feature to the library. I don't really have any vested interest in whether or not this gets merged, but being able to capture and alter a set-cookie header in-flight after it's sent by the application inside of the reverse proxy is extremely useful and fits well with the rest of the functionality in this library IMO.

It's your call if you're interested in the functionality. #11 was never closed by any other PR.

At this point I would have trouble finding the time to write that test suite though.

maurizioabba commented 1 year ago

Understood. Yes this can not be reviewed without tests. Keeping it closed for now, but if you or someone else will have time to provide appropriate testsuites, please reopen so that we can review.

Thank you!