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

[Enhancement] Don't override stdlib for force_resolve implementation #4662

Open
syeopite opened this issue Apr 29, 2024 · 2 comments
Open

[Enhancement] Don't override stdlib for force_resolve implementation #4662

syeopite opened this issue Apr 29, 2024 · 2 comments
Labels
enhancement Improvement of an existing feature module:http-client HTTP (youtube servers side) type:upstream The problem lies in one of the libraries, not in Invidious itself

Comments

@syeopite
Copy link
Member

syeopite commented Apr 29, 2024

Is your enhancement request related to a problem? Please describe.

The current force_resolve implementation relies on patching the HTTP::Client in stdlib. It really isn't good practice.

Describe the solution you'd like

I've recently been made aware that it is possible to force the HTTP::Client to resolve a specific IP family without overriding the stdlib implementation.

See crystal-lang/crystal#14196 (comment)

The downside is that we'll lose the automatic reconnect feature.

Describe alternatives you've considered

Create a new http client that inherits from stdlib with force_resolve implementation

Additional context

@syeopite syeopite added the enhancement Improvement of an existing feature label Apr 29, 2024
@SamantazFox
Copy link
Member

Thanks for opening an upstream issue for that!

@SamantazFox SamantazFox added type:upstream The problem lies in one of the libraries, not in Invidious itself module:http-client HTTP (youtube servers side) labels May 13, 2024
@syeopite
Copy link
Member Author

Alternatively, we could just create a new client object that inherits from the stdlib HTTP::Client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of an existing feature module:http-client HTTP (youtube servers side) type:upstream The problem lies in one of the libraries, not in Invidious itself
Projects
None yet
Development

No branches or pull requests

2 participants