8000 Refactor workspace app auditing to include HTTP status codes returned outside of `Issue` · Issue #517 · coder/internal · GitHub
[go: up one dir, main page]

Skip to content
Refactor workspace app auditing to include HTTP status codes returned outside of Issue #517
Open
@mafredri

Description

@mafredri
          @mafredri one thing we could do is have `proxyWorkspaceApp` return the reverse proxy and an error/boolean/something. That way the code can look _something_ like:
token, audit, ok := ResolveRequest(rw, r, ResolveRequestOptions{
// ....

proxy, err := s.proxyWorkspaceApp(rw, r, *token, chiPath, appurl.ApplicationURL{})

audit()
proxy.ServeHTTP(rw, r)

That would catch all the top level proxy errors. It is a bit of a refactor, and I am sure I am not thinking of something. However the audit log up front feels like an improvement, and we do not need to hook into the status writer.

Originally posted by @Emyrk in coder/coder#16801 (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

      0