Skip to content

registry: access log shows status 500 when the client received 200 #5111

Done

Description

@jgehrcke

Description

We found and discussed this while working on #5052 and #5103.

The access log keeps the status of the last WriteHeader call, also of a call made after the response header was sent (Gorilla's responseLogger.WriteHeader).

Example: a handler writes hello, then calls WriteHeader(500). The client gets 200. The access log shows "GET /write-then-500 HTTP/1.1" 500 5. #4937 describes a registry path that does this.

Reproduced on main at 18901785 with Go 1.26.11 and 1.27.4, with a test that wraps a handler in CombinedLoggingHandler as NewRegistry does.

#5103 fixes this for Write and Flush. It does not fix it for a ReadFrom that returned http.ErrContentLength, but registry code cannot reach that case, with or without #5052.

Reproduce

--

Expected behavior

--

registry version

--

Additional Info

No response

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions