-
Notifications
You must be signed in to change notification settings - Fork 1k
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
replicator session auth cannot handle multiple Set-Cookie headers in /_session request #5064
Labels
Comments
Playing a bit with mochiweb headers parser, I think we may have to use Heads = mochiweb_headers:from_binary([<<"Content-Length:47\r\n">>, <<"Set-Cookie:Custom=ABC; Version=42\r\n">>, <<"Foo:bar\r\n">>, <<"sEt-cOokie:Kustom=DEF; Version=43\r\n\rn">>]), ok.
ok
> mochiweb_headers:get_value("set-cookie", Heads).
"Kustom=DEF; Version=43, Custom=ABC; Version=42"
> mochiweb_headers:get_primary_value("set-cookie", Heads).
"Kustom=DEF"
> mochiweb_headers:get_combined_value("set-cookie", Heads).
undefined
> mochiweb_headers:to_list(Heads).
[{'Content-Length',"47"},
{"Foo","bar"},
{'Set-Cookie',"Kustom=DEF; Version=43"},
{'Set-Cookie',"Custom=ABC; Version=42"}] |
nickva
added a commit
that referenced
this issue
May 22, 2024
Previously, replicator auth session plugin crashed if additional cookie headers were added besides the default `AuthSession` one. Fix replicator session plugin to consider only `Set-Cookie` headers with 'AuthSession' set and ignore others. Co-Authored-By: Robert Newson <rnewson@apache.org> Fix: #5064
nickva
added a commit
that referenced
this issue
May 22, 2024
Previously, replicator auth session plugin crashed if additional cookie headers were added besides the default `AuthSession` one. Fix replicator session plugin to consider only `Set-Cookie` headers with 'AuthSession' set and ignore others. Co-Authored-By: Robert Newson <rnewson@apache.org> Fix: #5064
big-r81
pushed a commit
that referenced
this issue
May 22, 2024
Previously, replicator auth session plugin crashed if additional cookie headers were added besides the default `AuthSession` one. Fix replicator session plugin to consider only `Set-Cookie` headers with 'AuthSession' set and ignore others. Co-Authored-By: Robert Newson <rnewson@apache.org> Fix: #5064
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A HTTP response for
/_session
that includes twoSet-Cookie
headers leads to a{error, cookie_format_invalid};
error and failed replication job/For example. a load balancer could introduce its own
Set-Cookie
lines:And the session auth handler doesn’t handle this correctly. The only workaround is forcing the
_noop
handler which has other downsides.The text was updated successfully, but these errors were encountered: