-
Notifications
You must be signed in to change notification settings - Fork 79
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
wait-on claims endpoint is returning 404, when it's actually returning 200. #78
Comments
Interestingly, |
Same issue on a health check handler |
wait-on by default does a HEAD request since that is idempotent. GET's are also supposed to be idempotent but sometimes the user implementation performs side effects. In an ideal world you should always be able to make HEAD requests to a server if it is implemented properly so I am surprised when server implementations do not implement the HEAD method, it makes no sense to me. Anyway if you need to do a GET request instead, change the URL to Your command would look like npx wait-on https-get://127.0.0.1:8080/login |
As noted in my bug report above, this is exactly what I'm doing:
|
sorry @jwalton I misread your comments above. Maybe axios is doing a HEAD request pre-flight or something. Previously we used request until it was no longer supported, so there are some differences between it and axios and maybe this is one of them. I will see if there is an option we can pass to skip that. |
Missed that. Unfortunately, I don't own the service I'm making the health check to so I can't update it to accept HEAD requests. Prefacing with |
I'm also having this problem with a Vite dev server. I see the same results ("Request failed with status code 404") regardless of whether I use
In other tools, requesting the same URL gives a 200 OK, although HEAD does return a 404. |
For now, a workaround would be using
|
I was getting a 404 when using Vite, not Webpack, but the solution I found might work for you too;
You need a config file to send a header;
|
I'll see if I can find anything this weekend.
…On Thu, Jun 24, 2021 at 12:16 PM Adam Lynch ***@***.***> wrote:
I was getting a 404 when using Vite, not Webpack, but the solution I found
might work for you too;
1. Use GET not HEAD, i.e. use https-get:.
2. Send an accept: text/html header.
You need a config file to send a header; waitOnConfig.json:
{
"headers": {
"accept": "text/html"
}
}
wait-on -c waitOnConfig.json https-get://localhost:3001
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABMOOV67JZVEEGJX4OQI3TUNR6HANCNFSM4QH35UGQ>
.
--
Jeff Barczewski
Founder of CodeWinds
http://codewinds.com/
Live and Online developer training
|
|
Thanks for the tips @xkim1994 , it works well! (using Vite here). |
Why would Vite return a 404 for |
I have a webpack-dev-server running in HTTPS mode:
wait-on
will correctly tell me the URL is up with no path:passes no problem, but it fails for /login:
But curl gets a 200 OK:
And
cross-fetch
finds it fine, too:The text was updated successfully, but these errors were encountered: