Skip to content

Apply suggestions for http dir from ai code review#839

Merged
ithewei merged 11 commits into
masterfrom
bugfix/ai-code-review
May 23, 2026
Merged

Apply suggestions for http dir from ai code review#839
ithewei merged 11 commits into
masterfrom
bugfix/ai-code-review

Conversation

@ithewei
Copy link
Copy Markdown
Owner

@ithewei ithewei commented May 23, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 23, 2026 15:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies a set of hardening fixes across the HTTP server stack, primarily improving correctness for CORS responses, proxy error handling/timeouts, static file range handling, and multipart form file saving.

Changes:

  • Add Vary: Origin behavior to CORS responses when reflecting a non-wildcard Origin.
  • Harden static file Range handling (return 416 for invalid ranges) and fix proxy timeout application to the upstream connection.
  • Add error handling for short writes when saving multipart form uploads to disk.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
http/server/HttpMiddleware.cpp Updates CORS middleware to cache the Origin header value and add Vary: Origin when reflecting Origin.
http/server/HttpHandler.cpp Adds invalid Range handling (416), switches forbidden proxy paths to immediate status responses, and applies proxy timeouts to upstream_io.
http/HttpMessage.h Checks for short writes when persisting multipart form file content and returns 500 on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread http/server/HttpMiddleware.cpp
Comment thread http/HttpMessage.h
@ithewei ithewei merged commit bb675b8 into master May 23, 2026
13 checks passed
Yundi339 pushed a commit to Yundi339/libhv that referenced this pull request May 23, 2026
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