Skip to content

SSR causes 302 redirects to normalized URL #33053

@kon72

Description

@kon72

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

No response

Description

Previously someone pointed out that SSR causes lots of 302 redirects (#31881).
The fix landed in #31883 but we are still facing the similar issue for other URL patterns.
I expect that Angular server returns 200 OK and then URL normalization happens solely on the client side.

  • /?empty redirects to /?empty=
  • /?scope=email+profile redirects to /?scope=email%20profile
  • /?bbb=1&aaa=2&bbb=3 redirects to /?bbb=1&bbb=3&aaa=2
  • //foo redirects to /foo

Minimal Reproduction

ng serve and access to URLs above

export const serverRoutes: ServerRoute[] = [
  {
    path: '**',
    renderMode: RenderMode.Server,
  },
];

Exception or Error


Your Environment

Angular CLI       : 21.2.8
Angular           : 21.2.10
Node.js           : 24.15.0
Package Manager   : pnpm 10.26.1
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.8            │ ^21.2.8           │
│ @angular/cdk              │ 21.2.8            │ ^21.2.8           │
│ @angular/cli              │ 21.2.8            │ ^21.2.8           │
│ @angular/common           │ 21.2.10           │ ^21.2.10          │
│ @angular/compiler         │ 21.2.10           │ ^21.2.10          │
│ @angular/compiler-cli     │ 21.2.10           │ ^21.2.10          │
│ @angular/core             │ 21.2.10           │ ^21.2.10          │
│ @angular/forms            │ 21.2.10           │ ^21.2.10          │
│ @angular/material         │ 21.2.8            │ ^21.2.8           │
│ @angular/platform-browser │ 21.2.10           │ ^21.2.10          │
│ @angular/platform-server  │ 21.2.10           │ ^21.2.10          │
│ @angular/router           │ 21.2.10           │ ^21.2.10          │
│ @angular/ssr              │ 21.2.8            │ ^21.2.8           │
│ rxjs                      │ 7.8.2             │ ^7.8.2            │
│ typescript                │ 5.9.3             │ ^5.9.3            │
│ vitest                    │ 4.1.4             │ ^4.1.4            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions