'How do I allow restricted characters in the URL of a .net core application?

Previously, to allow for encoded special characters to be passed as part of a URL in a .net framework service, I've added this to the web.config file within the system.web node:

<httpRuntime requestPathInvalidCharacters="" relaxedUrlToFileSystemMapping="true" />

What is the equivalent for a .net core application?

An example of the test data I need to allow would be 'searchterm%26' which is the encoded output of 'searchterm&'



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source