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-2277: RFC 9111 conformance improvements / bug fixes #501

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

ok2c
Copy link
Member

@ok2c ok2c commented Nov 4, 2023

  • Aligns the behavior of the caching protocol handlers with the specification requirements (sections 3 and 4 RFC 9111)
  • Improved normalization of variant header elements
  • Bug fixes

@ok2c ok2c marked this pull request as draft November 4, 2023 10:15
@ok2c
Copy link
Member Author

ok2c commented Nov 4, 2023

@arturobernalg This PR is still work in progress. Do take a look at the changes in ResponseCachingPolicy and CachedResponseSuitabilityChecker and let me know if find anything disagreeable.

@ok2c ok2c force-pushed the HTTPCLIENT-2277 branch 3 times, most recently from 31fbaee to d37aba9 Compare November 5, 2023 11:05
@ok2c ok2c marked this pull request as ready for review November 5, 2023 11:06
@ok2c
Copy link
Member Author

ok2c commented Nov 5, 2023

@arturobernalg Please review.

@arturobernalg
Copy link
Member

@arturobernalg Please review.

I haven't forgotten about this PR.

@ok2c ok2c force-pushed the HTTPCLIENT-2277 branch 2 times, most recently from 8c1de25 to 6f4fc08 Compare November 11, 2023 20:06
Copy link
Member

@arturobernalg arturobernalg left a comment

Choose a reason for hiding this comment

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

@ok2c this change-set LGTM

@Internal
public static void normalizeElements(final Iterator<Header> iterator, final Consumer<String> consumer) {
final List<HeaderElement> elements = new ArrayList<>();
final Iterator<HeaderElement> it = new BasicHeaderElementIterator(iterator);
Copy link
Member

Choose a reason for hiding this comment

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

We can streamline the process by using StreamSupport.stream to create a stream directly from the Iterator<HeaderElement>. This approach eliminates the need for an intermediate collection and allows us to process elements in a single pipeline, which is more memory-efficient and idiomatic to the stream API.

Copy link
Member Author

Choose a reason for hiding this comment

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

@arturobernalg Agreed. Corrected. Please take another look.

Copy link
Member

Choose a reason for hiding this comment

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

@arturobernalg Agreed. Corrected. Please take another look.

Perfect. LGTM

…ecification requirements per RFC 9111 section 4
…the specification requirements per RFC 9111 section 4
… the current request message with additional headers generated by the previous request interceptors instead of the original request message
@ok2c ok2c merged commit 2ce9466 into apache:5.4.x Nov 16, 2023
7 checks passed
@ok2c ok2c deleted the HTTPCLIENT-2277 branch November 16, 2023 19:04
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