Skip to content

fix http status code#193

Open
oops-oom wants to merge 1 commit into
langgenius:mainfrom
oops-oom:fix_http_status_header
Open

fix http status code#193
oops-oom wants to merge 1 commit into
langgenius:mainfrom
oops-oom:fix_http_status_header

Conversation

@oops-oom

Copy link
Copy Markdown

err = r.BindJSON(&request) will write http header to client if err. After this, r.JSON(200, resp) willl cause warning Headers were already written. Wanted to override status code 400 with 200

[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 200
[GIN] 2025/11/17 - 03:42:24 | 400 | 110.582µs | 172.17.0.1 | POST "/v1/sandbox/run"
[GIN] 2025/11/17 - 03:42:24 | 400 | 133.045µs | 172.17.0.1 | POST "/v1/sandbox/run"

Signed-off-by: binnnliu <binnnliu@tencent.com>
@oops-oom

Copy link
Copy Markdown
Author

@Yeuoly Could you please review this PR?

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.

1 participant