Skip to content

Commit efb693f

Browse files
Parse cookies on redirect (#6987)
Fixes: #3954 When using the `AllowAutoRedirect` feature of `AndroidMessageHandler` to automatically follow 3xx redirects, the cookies that are returned together with the redirection are not processed. If the redirection target requires the cookies returned by the first request, the call will fail. This change fixes this behavior and always processes the cookies before the redirection takes place.
1 parent 82d16ae commit efb693f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,12 @@ internal Task WriteRequestContentToOutputInternal (HttpRequestMessage request, H
582582
}
583583
}
584584

585+
CopyHeaders (httpConnection, ret);
586+
ParseCookies (ret, connectionUri);
587+
585588
if (disposeRet) {
586589
ret.Dispose ();
587590
ret = null!;
588-
} else {
589-
CopyHeaders (httpConnection, ret);
590-
ParseCookies (ret, connectionUri);
591591
}
592592

593593
// We don't want to pass the authorization header onto the next location

0 commit comments

Comments
 (0)