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

Discussion: how to handle redirects? #54

Open
fibonacci1729 opened this issue Feb 6, 2025 · 4 comments
Open

Discussion: how to handle redirects? #54

fibonacci1729 opened this issue Feb 6, 2025 · 4 comments

Comments

@fibonacci1729
Copy link
Contributor

fibonacci1729 commented Feb 6, 2025

Should the rust sdk provide a mechanism to allow devs to specify that redirects should be followed (up to some limit)? For instance, there are various crates that provide this support for hyper clients which seems fairly useful.

I'm not entirely sure at the moment what the other sdks do regarding this behavior but if there is a precedent we should likely follow that if it exists.

@lann
Copy link
Contributor

lann commented Feb 6, 2025

Does this even need to be part of the SDK? Should we publish a totally separate reqwest-esque wasi-http client?

@fibonacci1729
Copy link
Contributor Author

fibonacci1729 commented Feb 6, 2025

Posted here because I started to implement a solution in the context of the sdk but I agree some solution (whether in-tree or a separate crate) would work for my usecase.

A separate reqwest-esque wasi-http client crate seems like a good path.

@itowlson
Copy link
Contributor

A complicating factor is that (if memory serves) some Spin hosts automatically follow redirects without the SDK getting to have a look in, and others do not. (Unless this has since been rationalised. I can't find an issue for it...)

There are some challenges involved in following redirects guest-side: spinframework/spin#1881

@lann
Copy link
Contributor

lann commented Feb 10, 2025

IIRC the old spin-specific interface follows redirects (in spin up at least) but the wasi-http interface never has. (edit: which...is what spinframework/spin#1881 says 😅)

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

No branches or pull requests

3 participants