这是indexloc提供的服务,不要输入任何密码
Skip to content

Make TE Header optional #875

@adiykehler

Description

@adiykehler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions