Visitar URL original
ng serve does not recognize "Accept: */*" header and returns a 404 for requests with route fragments · Issue #12613 · angular/angular-cli · GitHub
The Wayback Machine - https://web.archive.org/web/20260604050419/https://github.com/angular/angular-cli/issues/12613
Skip to content

ng serve does not recognize "Accept: */*" header and returns a 404 for requests with route fragments #12613

@vsviridov

Description

@vsviridov

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [X] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.0.5                                              
Node: 8.11.3                                                    
OS: linux x64                                                   
Angular: 6.0.5 

Repro steps

curl -sv "http://angular-app/someRoute" -H "Accept: text/html" returns 200
curl -sv "http://angular-app/someRoute" -H "Accept: */*" returns 404

run ng serve and try accessing the site in IE using short form for the url

Caveats

Do not use FQDN
Use a route fragment

Investigation

IE in some cases enforces compatibility mode for intranet sites.
Short form domain name makes IE think it's an intranet site
IE sends different Accept header in compatibility mode, but it does include a */* fallback
ng serve express middleware does some content negotiation and seems to ignore */* prefering text/html

The log given by the failure

No log. if DEBUG="*" ng serve is used, I can see the middleware sending 404.

Desired functionality

Content negotiation should correctly recognize the */* fallback

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions