Skip to content

Modifying request HTTP headers based on the content of request body #10

@huang195

Description

@huang195

I see the following comments in all the functions to manipulate request headers:

// ReplaceHttpRequestHeaders is used for replacing HTTP request headers
// with given headers. Only available during
// types.HttpContext.OnHttpRequestHeaders.
func ReplaceHttpRequestHeaders(headers [][2]string) error {
    return setMap(internal.MapTypeHttpRequestHeaders, headers)
}

that they are only available during OnHttpRequestHeaders(). However, I'd like to inspect of the body of the request in OnHttpRequestBody(), and then conditionally modify the request headers. Is this not possible today? Or is there a coding pattern that could help with my situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions