Skip to content

Feature Request: get current response headers or unset them alll #4770

Closed

Description

@jonathanong

https://github.com/koajs/koa/blob/fcacb352208115e60fffe145394f904743dfa8c3/lib/context.js#L121 so we don't have to do hacks like this.

Would like at least one of the following:

// get all header keys
res.getHeaderKeys() // => ['content-type', 'content-length']

// unset all headers
res.unsetHeaders()

I think (from reading issues a while ago) that all the headers are stored in node as [ [<key>, <value>] ] pairs. i don't mind making that public, either.

Activity

  1. jonathanong commented on Jan 19, 2016

    @jonathanong
    ContributorAuthor

    oh sorry, didn't read #1873 thoroughly enough

  2. added
    duplicate
    feature request
    http
    on Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatefeature requesthttp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions