Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie Filtering: Secure string not removed #10

Open
hauntedhill opened this issue Jul 6, 2020 · 0 comments
Open

Cookie Filtering: Secure string not removed #10

hauntedhill opened this issue Jul 6, 2020 · 0 comments

Comments

@hauntedhill
Copy link

Hello,

the secure string is not removed from the cookies, i edit the coding to get it work:

    // We always filter the secure header to avoid the cookie from
            //	"not" beeing included in follow up requests in case of the
            //	proxy is running on HTTP and not HTTPS
            let cookies = res.getHeader("set-cookie");
            // array == multiple cookies
            if (Array.isArray(cookies)) {
                for (let i = 0; i < cookies.length; i++) {
					//cookies[i] = cookies[i].replace("secure;", "");
                    cookies[i] = cookies[i].replace("secure", "");
                }
            } else if (typeof cookies === "string" || cookies instanceof String) {
                // single cookie
				//cookies = cookies.replace("secure;", "");
                cookies = cookies.replace("secure", "");
            }

The reason is that the secure string not allows ends with ";"

Please fix that.

Thanks

Haunted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant