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

Sample domain in Faraday docs needs to be updated #1164

Closed
mokolabs opened this issue Jul 9, 2020 · 10 comments
Closed

Sample domain in Faraday docs needs to be updated #1164

mokolabs opened this issue Jul 9, 2020 · 10 comments

Comments

@mokolabs
Copy link

mokolabs commented Jul 9, 2020

Basic Info

  • Faraday Version: All
  • Ruby Version: All

Issue description

Faraday docs use sushi.com as a sample domain for code examples. However, it appears registration for the domain lapsed at some point, and it was grabbed by a domain name scalper.

As a result, many of the existing code examples either don't work at all or produce divergent output from the docs.

For instance, the very first code example:

Make a simple GET request by requiring the Faraday gem and using Faraday.get:

response = Faraday.get 'http://sushi.com/nigiri/sake.json'

This returns a Faraday::Response object with the response status, headers, and body.

response.status
# => 200

In fact, this returns a 301 because the new host for the sushi.com domain is redirecting http requests to https. If you follow the redirect via Faraday (with the extra required code), you'll eventually get a 404 because sake.json no longer exists on the domain.

Steps to reproduce

See above.

@iMacTia
Copy link
Member

iMacTia commented Jul 18, 2020

Thanks @mokolabs for raising this.
Having those examples working is not really too important, they're mostly there for illustration purposes.
That said, I agree with you it would be even better if they actually worked 😃
I used example.com in the past but that also looks down at the moment!
Maybe we could use Postman Echo, or I'm open to other suggestions.

I'd also be glad if someone from the community would like to pick this up, I'll flag it as a good first issue 👍

@mokolabs
Copy link
Author

Okay, cool. I can take this one on.

@gurgeous
Copy link
Contributor

I use httpbingo.org extensively in both docs and tests. It's a go port of the old httpbin.org service. Great resource if you haven't seen it before. I even simulate it in my tests with webmock...

@JAugusto42
Copy link
Contributor

Hi all, would like to start contributing trying to help with the doc for while, i attach a pull request suggesting an adjustment.

@olleolleolle
Copy link
Member

@JAugusto42 Cool, thanks for fixing that - does that complete this ticket?

@JAugusto42
Copy link
Contributor

I believe so, i'm going to go through the other pages...but i believe that's it.

@iMacTia
Copy link
Member

iMacTia commented Jan 18, 2022

There are still occurrences of sushi.com in some docs and even some tests, should we change those as well before closing this?
@JAugusto42 were you planning to open any follow-up PRs?

@JAugusto42
Copy link
Contributor

sure i can work on that

@JAugusto42
Copy link
Contributor

now I don't think it has any more references to sushi.com

@mokolabs
Copy link
Author

Belatedly... thank you for fixing this, @JAugusto42!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants