Server returns 404 when performing HEAD request
See original GitHub issueOS?
macOS Sierra 10.12.3
Versions.
1.0.0-rc.0
Repro steps.
- Perform HEAD request to the spawned server by
ng serve
using (cURL, fetch, Angular HTTP, XHR) and it will automatically return 404.
Mention any other details that might be useful.
When the URL provided is: http://localhost:4200/assets/img/ui/logo.png (assuming it exists) it returns 404. But when the URL provided is: http://localhost:4200/src/assets/img/ui/logo.png it returns 200.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Server returns a 404 code when requesting HEAD?
Well, I'll answer myself on that one. The problem is not from NGinx but from the backend, here, PlayFramework that returns a 404...
Read more >IIS responding with 404 on HTTP HEAD request - MSDN
It seems that Selenium sends a HEAD request to my route /Home/Index before it sends the GET request. This causes all my tests...
Read more >Should POST request return 404 if reference to other entity fails?
I think it depends on whether the ID is in the URL or not. The URL is the address for a resource, if...
Read more >404 Not Found Error: What It Is and How to Fix It - Airbrake Blog
Some web applications "fake" 404 Not Found Errors when requesting an invalid resource. The server returns a standard 200 OK response code, ...
Read more >The REST API encountered an unexpected result = 404 Not ...
The requested URL was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@exequiel09 It might be that the
webpack-dev-server
we use inng serve
does not support HEAD requests as configured. If that’s an option we can include it.@Daedalon the change I mentioned prevented files that were not in a build from being served from
ng serve
. Files that are on disk but are not included in a build should not be served because they are not part of the files that go indist/
afterng build
. That is not a breaking change - you were just relying on a bug and we fixed that bug.@filipesilva perform a curl
HEAD
request. I attached screenshots of what’s happening. PerformingGET
request works but usingHEAD
request fails. I useHEAD
request to check if the file is really present on theassets
directory.