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

Requests with manual redirects not working properly #5

Open
ruochenjia opened this issue Apr 3, 2023 · 0 comments
Open

Requests with manual redirects not working properly #5

ruochenjia opened this issue Apr 3, 2023 · 0 comments

Comments

@ruochenjia
Copy link

ruochenjia commented Apr 3, 2023

I'm using Bare Client on my websites to bypass CORS policy, but some supported functions did not work as expected.

redirect: "manual" is a supported attribute declared in BareFetchInit, but it seems to have no effects.

const request = new Request("http://1.1.1.1", { // I use this website as an example because it redirects to https with 301 response
	method: "GET",
	redirect: "manual"
});

const response = await bareClient.fetch(request);
// 301 responses should be returned as is, but seems to be followed and returns a redirected response with status 200

response.status // should be '301', but is 200
response.ok // should be false as 'status' is not 200
response.headers.get("location") // should give me the redirect url, but returns null
@e9x e9x closed this as completed May 24, 2023
@e9x e9x reopened this May 24, 2023
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

2 participants