Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Misuse of http.Header{}.Write(...) #1361

@kminehart

Description

@kminehart

Describe the bug

I made a bad assumption in my last PR, that http.Header would write an http.Header to a response. Header.Write isn't super well documented, so I definitely should have done more research.

Instead of writing header(s) to the response, it essentially sent the data through the writer (the http.ResponseWriter's Write function) and wrote it to the body after the JSON.

So you'd end up getting

{
...
}Link:</clients?limit=10&offset=10>; rel="next"...

in your response.

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