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

200 now returned for missing assets instead of 404 #26917

Closed
1 task done
jamesbrobb opened this issue Jan 22, 2024 · 1 comment · Fixed by #26931
Closed
1 task done

200 now returned for missing assets instead of 404 #26917

jamesbrobb opened this issue Jan 22, 2024 · 1 comment · Fixed by #26931

Comments

@jamesbrobb
Copy link

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16

Description

I've updated a project from 16.2.11 to 17.1.0

When an attempt to load a missing asset is made the response is a 200 containing index.html instead of the expected 404.

This happens when using ng serve to run development locally, but i'm also seeing the same issue when deploying my production build to a staging server.

Minimal Reproduction

https://github.com/jamesbrobb/v17-missing-asset-issue

Exception or Error

200 returned instead of 404 when asset does not exist

Your Environment

Angular CLI: 17.1.0
Node: 20.10.0
Package Manager: npm 10.2.3
OS: darwin x64

Angular: 17.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.0
@angular-devkit/build-angular   17.1.0
@angular-devkit/core            17.1.0
@angular-devkit/schematics      17.1.0
@angular/cdk                    17.0.5
@angular/material               17.0.5
@schematics/angular             17.1.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.3

Anything else relevant?

No response

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes angular#26917
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes angular#26917
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 24, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes angular#26917
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 24, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes angular#26917
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 24, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes angular#26917
alan-agius4 added a commit that referenced this issue Jan 24, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes #26917
alan-agius4 added a commit that referenced this issue Jan 24, 2024
…t found

This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes #26917

(cherry picked from commit 8216b11)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants