Skip to content

Proxying headers by default is magical #1863

Open
@szmarczak

Description

@szmarczak

Related #1748 #743 #1746 #148 #275 #401

await pipeline(
    request,
    instance.stream(request.url, {
        method: request.method,
		// This won't work: headers will be copied from `request` anyway
        headers: withoutHopByHop(request.headers),
        decompress: false,
        followRedirect: false,
        throwHttpErrors: false,
        http2: false,
        proxyUrl,
    }).on('response', (httpResponse) => {
        httpResponse.headers = withoutHopByHop(httpResponse.headers);
    }),
    response,
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThe issue is a question about Got

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions