Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created March 19, 2014 02:10
Show Gist options
  • Save darrelmiller/9634264 to your computer and use it in GitHub Desktop.
Save darrelmiller/9634264 to your computer and use it in GitHub Desktop.
public class RunscopePassagewayHandler : DelegatingHandler {
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) {
if (request.RequestUri.Host.Contains("passageway.io")) {
var uriWithoutPort = request.RequestUri.GetComponents(UriComponents.AbsoluteUri & ~UriComponents.Port, UriFormat.UriEscaped);
request.RequestUri = new Uri(uriWithoutPort);
}
return base.SendAsync(request, cancellationToken);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment