Skip to content

200 now returned for missing assets instead of 404 #26917

Closed

Description

@jamesbrobb

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

Activity

  1. added 5 commits that reference this issue on Jan 23, 2024
    cae8bf8
    c57c2b6
    b4cf68d
    de589f3
    b83e3db
  2. added 2 commits that reference this issue on Jan 24, 2024
    8216b11
    3deb0d4
  3. angular-automatic-lock-bot commented on Feb 24, 2024

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions