Commit 0ee174c
authored
[tests] Switch to
Context: 234cf2c
Commit 234cf2c updated the
`AndroidHandlerTestBase.Redirect_Without_Protocol_Works()` and
`AndroidHandlerTestBase.Redirect_POST_With_Content_Works()` tests to
use <httpbingo.org> to test HTTP redirect behavior.
Recently, <httpbingo.org> started returning HTTP-403 for our
redirection test, whereas we expected it to send HTTP-302:
% curl -D - 'https://httpbingo.org/redirect-to?url=https://github.com/xamarin/xamarin-android'
HTTP/2 403
access-control-allow-credentials: true
access-control-allow-origin: *
content-type: text/plain; charset=utf-8
x-content-type-options: nosniff
date: Wed, 16 Nov 2022 15:38:02 GMT
content-length: 51
server: Fly/5f2bf728 (2022-11-11)
via: 2 fly.io
fly-request-id: 01GJ0HE398V7F0BKFHY0D2N8YE-iad
Forbidden redirect URL. Be careful with this link.
This caused the `Redirect_Without_Protocol_Works()` and
`Redirect_POST_With_Content_Works()` unit tests to start failing:
System.Net.Http.HttpRequestException : Response status code does not indicate success: 403 (Forbidden).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode ()
at Xamarin.Android.NetTests.AndroidHandlerTestBase.Redirect_POST_With_Content_Works ()
Update the tests to *stop* using <httpbingo.org> and instead use
<httpbin.org>. This allows our tests to work as expected:
% curl -D - 'https://httpbin.org/redirect-to?url=https://github.com/xamarin/xamarin-android'
HTTP/2 302
date: Wed, 16 Nov 2022 15:38:28 GMT
content-type: text/html; charset=utf-8
content-length: 0
location: https://github.com/xamarin/xamarin-android
server: gunicorn/19.9.0
access-control-allow-origin: *
access-control-allow-credentials: truehttpbin.org (#7556)1 parent acfc1ef commit 0ee174c
File tree
1 file changed
+2
-2
lines changed- tests/Mono.Android-Tests/Xamarin.Android.Net
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
0 commit comments