Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TE Header optional #875

Open
adiykehler opened this issue Aug 30, 2023 · 1 comment
Open

Make TE Header optional #875

adiykehler opened this issue Aug 30, 2023 · 1 comment

Comments

@adiykehler
Copy link

adiykehler commented Aug 30, 2023

I'm using Fuel Version 2.3.1 on Openjdk 17.0.8.1.
I have encountered an application that rejects any HTTP requests containing the TE header. I would like to remove this header from the requests made with Fuel. Could you please add an option to remove the TE header entirely.

I tried using the RequestInterceptor, but the header seems to be added later on. It is not present when using the HttpUrlConnection, so I suspend this to be something added by Fuel.

FuelManager().apply {
    addRequestInterceptor(
        object : FoldableRequestInterceptor {
            override fun invoke(next: RequestTransformer): RequestTransformer {
                return { request ->
                    println(request.headers)
                    request.headers.remove("TE")
                    next(request)
                }
            }
        }
    )
}

Additional resources

@Jfreu
Copy link

Jfreu commented Nov 6, 2023

Same issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants