question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Router should support case-insensitive root index.html

See original GitHub issue

πŸš€ feature request

Relevant Package

This feature request is for @angular/router.

Description

I am aware that Router paths are case-sensitive. While personally I disagree with that, I can work around it with a custom DefaultUrlSerializer. What I cannot work around is when a request comes in for /INDEX.HTML. While my custom DefaultUrlSerializer will essentially make Router work with case-insensitive URLs by lower-casing everything, it doesn’t appear to work for /INDEX.HTML.

I am also aware that the case-sensitivity problem has been brought up before (https://github.com/angular/angular/issues/7691, etc), but I think this is a unique case that is worth looking at.

Describe the solution you’d like

Since Router already appears to handle /index.html internally somewhere, I think in this one-off case it should handle it in a case-insensitive manner to prevent the Cannot match any routes error.

Describe alternatives you’ve considered

I do not see an alternative. I welcome any workarounds!

Sample project / reproduction

I hesitated a bit in considering this a feature request, but in case this is classified as a bug, I put together a repro here.

  1. Expand the console on the right and add /index.html to the address bar and refresh. You will not see anything wrong.
  2. Try using /INDEX.HTML and you will see an error (in the console), even though my custom DefaultUrlSerializer lower-cased it (as seen in the console).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
angular-robot[bot]commented, Jun 24, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

1reaction
angular-robot[bot]commented, Jun 4, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular’s feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should URL be case sensitive? - Stack Overflow
Domain names are case insensitive according to RFC 4343. The rest of URL is sent to the server via the GET method. This...
Read more >
Angular url case insensitive - CodeProject
I try <pre>import { DefaultUrlSerializer, UrlTree } from '@angular/router'; export class LowerCaseUrlSerializer extends DefaultUrlSerializer {Β ...
Read more >
Case sensitivity with angularjs ui router - YouTube
angular ui router case insensitiveIn this video we will discuss how to make routes that are configured using ui- router case - insensitive....
Read more >
Make Drupal handle incoming paths in a case-insensitive ...
Yes, anything relating to paths should be case-sensitive, across the board, everywhere. If that's not the case, it's a bug. Log in or...
Read more >
ASP.NET Core Blazor routing and navigation - Microsoft Learn
Route parameter names are case insensitive. In the following example, the text parameter assigns the value of the route segment to theΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found