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

[tests] Switch to httpbin.org #7556

Merged
merged 1 commit into from
Nov 16, 2022
Merged

[tests] Switch to httpbin.org #7556

merged 1 commit into from
Nov 16, 2022

Conversation

dellis1972
Copy link
Contributor

httpbingo.org is returning the following error when we try to redirect.

Forbidden redirect URL. Be careful with this link.

To lets try to use httpbin.org directly instead.

`httpbingo.org` is returning the following error when we try to
redirect.

```
Forbidden redirect URL. Be careful with this link.
```

To lets try to use `httpbin.org` directly instead.
@dellis1972
Copy link
Contributor Author

Hmm getting a timeout now.

System.Net.Http.HttpRequestException : Response status code does not indicate success: 504 (Gateway Time-out).

But not on both tests...

@jonpryor
Copy link
Member

I think the HTTP-504 can be ignored; it probably means that AzDO couldn't connect to github.com, cause (waves hands in the air) "reasons".

The PR is green, and this is an improvement for our current tests.

@jonpryor jonpryor merged commit 0ee174c into dotnet:main Nov 16, 2022
@dellis1972 dellis1972 deleted the httpbin branch November 16, 2022 16:01
jonathanpeppers pushed a commit that referenced this pull request Nov 16, 2022
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: true
jonathanpeppers pushed a commit that referenced this pull request Nov 16, 2022
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: true
grendello added a commit to grendello/xamarin-android that referenced this pull request Nov 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants