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

AndroidMessageHandler: HTTP status code 308 is throwing an exception #8946

Closed
tipa opened this issue May 15, 2024 · 0 comments · Fixed by #8951
Closed

AndroidMessageHandler: HTTP status code 308 is throwing an exception #8946

tipa opened this issue May 15, 2024 · 0 comments · Fixed by #8951
Assignees
Labels
Area: HTTP Issues with sockets / HttpClient.

Comments

@tipa
Copy link

tipa commented May 15, 2024

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

.NET8

Description

This is a new issue after this one has been closed: #4477

Steps to Reproduce

var msg = new HttpRequestMessage(HttpMethod.Get, "https://httpbingo.org/status/304");
var result = await new HttpClient().SendAsync(msg); // no exception

var msg2 = new HttpRequestMessage(HttpMethod.Get, "https://httpbingo.org/status/308");
var result2 = await new HttpClient().SendAsync(msg2); // exception

Sending the first message does not cause an exception (which is the expected behavior), while the second one does.

Did you find any workaround?

No response

Relevant log output

No response

@tipa tipa added Area: App Runtime Issues in `libmonodroid.so`. needs-triage Issues that need to be assigned. labels May 15, 2024
@jpobst jpobst added Area: HTTP Issues with sockets / HttpClient. and removed Area: App Runtime Issues in `libmonodroid.so`. needs-triage Issues that need to be assigned. labels May 15, 2024
jonpryor pushed a commit that referenced this issue May 16, 2024
…#8951)

Fixes: #8946

Context: 1e5bfa3

For some reason we skipped [`HttpStatusCode.PermanentRedirect`][0]
(HTTP-308) when handling redirects in 1e5bfa3.

Update `AndroidMessageHandler.HandleRedirect()` to follow an HTTP
redirect on HTTP-308 errors.

[0]: https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=net-8.0#system-net-httpstatuscode-permanentredirect
jonathanpeppers pushed a commit that referenced this issue May 16, 2024
…#8951)

Fixes: #8946

Context: 1e5bfa3

For some reason we skipped [`HttpStatusCode.PermanentRedirect`][0]
(HTTP-308) when handling redirects in 1e5bfa3.

Update `AndroidMessageHandler.HandleRedirect()` to follow an HTTP
redirect on HTTP-308 errors.

[0]: https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=net-8.0#system-net-httpstatuscode-permanentredirect
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: HTTP Issues with sockets / HttpClient.
Projects
None yet
4 participants