Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPCLIENT-2293 - Implement RFC-compliant TRACE request interceptor #486

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

arturobernalg
Copy link
Member

@arturobernalg arturobernalg commented Sep 20, 2023

  • Add RequestTraceInterceptor class to handle HTTP TRACE requests in compliance with RFC 7231, Section 4.3.8.
  • Throw ProtocolException for sensitive headers like 'Authorization' and 'Cookie' in TRACE requests.
  • Throw ProtocolException if TRACE request contains a body.

@arturobernalg
Copy link
Member Author

Please @reschke take a look

}

// Check for sensitive headers
final Header authHeader = request.getHeader(HttpHeaders.AUTHORIZATION);
Copy link
Member

Choose a reason for hiding this comment

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

@arturobernalg I really dislike the idea of removing headers explicitly set by the caller. It feels wrong. Would you be OK with throwing a protocol exception instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ok2c

Fair enough. changed

  - Add RequestTraceInterceptor class to handle HTTP TRACE requests in compliance with RFC 7231, Section 4.3.8.
  - Throw ProtocolException for sensitive headers like 'Authorization' and 'Cookie' in TRACE requests.
  - Throw ProtocolException if TRACE request contains a body.
@arturobernalg arturobernalg merged commit 86b1d5c into apache:5.4.x Sep 23, 2023
7 checks passed
ok2c pushed a commit that referenced this pull request Dec 13, 2023
…486)

- Add RequestTraceInterceptor class to handle HTTP TRACE requests in compliance with RFC 7231, Section 4.3.8.
  - Throw ProtocolException for sensitive headers like 'Authorization' and 'Cookie' in TRACE requests.
  - Throw ProtocolException if TRACE request contains a body.
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