1

I was wondering if you can fake the Uri.Host value of a string. For example, given the following code:

new Uri(url.ToLower()).Host == "example.com"

Is there anyway to have this boolean comparison be true, but at the same time the URL go to a different server than example.com?

Anders
  • 65,582
  • 24
  • 185
  • 221
Rob Gates
  • 259
  • 5
  • 11

1 Answers1

1

There's no intentional or known way, and probably (hopefully) no way at all. If there were, it would be a very serious bug in the .NET framework.

However, note that this only guarantees that the host is actually example.com; it doesn't guarantee that traffic for this URI destined for example.com will actually make it there without interception.