Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

%E2%80%8B Appears in url .Net Core

I never experienced such issue, but it appears as part of route and if I manually enter route then the result is 404.

If I copy from swagger %E2%80%8B appears.

How can I fix this issue?

.Net Core 2.1

http://localhost/functionCodes/%E2%80%8Btest - works

http://localhost/functionCodes/test - 404

like image 537
Dzmitry Tserakhau Avatar asked Jul 31 '20 06:07

Dzmitry Tserakhau


People also ask

What does %E2 in a URL mean?

The URL trailing with the unwanted %e2%80%8e, is token of your defected copy and paste method. Here defected means, the copied words contains the unusual character or hidden space. Due to this, the URL becomes the ugly.

What is E2 80 8B in URL?

%E2%80%8B is the code for a "ZERO-WIDTH SPACE" character.

What is IApplicationBuilder in .NET Core?

IApplicationBuilder An object that provides the mechanisms to configure an application's request pipeline.


1 Answers

As per: this chart

%E2%80%8B is the code for a "ZERO-WIDTH SPACE" character.

It has probably been inserted without you noticing it somehow, you probably can't see it in your code, but it is here.

I recommend completely removing the string (including the surrounding quotes!) where the URL is defined and re-write it.

Since you use ASP.NET, this path may come from the name of an Action method in a Controller, but the solution is the same: remove completely the name of the Test() method, making sure you delete some space characters before that, and rewrite-it.

If you want to inspect this, you can probably use some advanced text editor or hexadecimal editor to view that it is actually in the source code.

There may be some Visual Studio extensions that would help you view these hidden characters as well.

like image 55
Pac0 Avatar answered Oct 03 '22 00:10

Pac0