Skip to content

Remove key from httpContext.Request.QueryString using QueryParameterRemoveTransform #768

Answered by Tratcher
MarkH007 asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you started here and are working with the low level IHttpProxy.

QueryParameterRemoveTransform is part of the higher level proxy infrastructure and wasn't designed to work directly with IHttpProxy. When using IHttpProxy you have the transformer that gives you direct access to the proxy request to make changes.

private class CustomTransformer : HttpTransformer
{
    public override async Task TransformRequestAsync(HttpContext httpContext,
        HttpRequestMessage proxyRequest, string destinationPrefix)
    {
        // Copy headers normally and then remove the original host.
        // Use the destination host from proxyRequest.RequestUri instead.
        await base.Transfor…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Tratcher
Comment options

@MarkH007
Comment options

Answer selected by karelz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants