Skip to content

fix: add missing return statements in error handler paths#6561

Merged
johanbrandhorst merged 1 commit intogrpc-ecosystem:mainfrom
jet-go:fix/fix-missing-return-in-error-handler
Apr 2, 2026
Merged

fix: add missing return statements in error handler paths#6561
johanbrandhorst merged 1 commit intogrpc-ecosystem:mainfrom
jet-go:fix/fix-missing-return-in-error-handler

Conversation

@jet-go
Copy link
Copy Markdown
Contributor

@jet-go jet-go commented Apr 2, 2026

References to other Issues or PRs

N/A

Have you read the Contributing Guidelines?

Yes

Brief description of what is fixed or changed

Add missing return after handling error to avoid modifying response headers after response is sent which causes error http: superfluous response.WriteHeader.

Other comments

This issue only happens with non-legacy unescape modes. The decision of whether % should be actually escaped or not depends on the escape mode & is not fixed/implemented in this PR.

Copy link
Copy Markdown
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@johanbrandhorst
Copy link
Copy Markdown
Collaborator

Looks like tests are failing under Bazel, for some reason:

==================== Test output for //runtime:runtime_test:
--- FAIL: TestMuxServeHTTP (0.00s)
    --- FAIL: TestMuxServeHTTP/28 (0.00s)
        mux_test.go:620: w.Body = "{\"code\":2, \"message\":\"malformed path escape \\\"%\\\"\", \"details\":[]}"; want "{\"code\":2,\"message\":\"malformed path escape \\\"%\\\"\",\"details\":[]}"; patterns=[{GET [2 0 1 0 4 1] [foo id] }]; req=&{GET https://host.example/foo/%25 HTTP/1.1 1 1 map[Content-Type:[application/json]] {} 0x709ac0 0 [] false host.example map[] map[] <nil> map[]   <nil> <nil> <nil>  {{}} <nil> [] map[]}

@jet-go jet-go force-pushed the fix/fix-missing-return-in-error-handler branch from 3f1cb81 to 98c8ea7 Compare April 2, 2026 18:22
@jet-go
Copy link
Copy Markdown
Contributor Author

jet-go commented Apr 2, 2026

fixed

@johanbrandhorst johanbrandhorst merged commit f8ae504 into grpc-ecosystem:main Apr 2, 2026
14 checks passed
@johanbrandhorst
Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants