Skip to content

[java] Return new input stream to allow multiple reads#11249

Merged
diemol merged 1 commit intoSeleniumHQ:trunkfrom
pujagani:read-req-multiple-times
Nov 11, 2022
Merged

[java] Return new input stream to allow multiple reads#11249
diemol merged 1 commit intoSeleniumHQ:trunkfrom
pujagani:read-req-multiple-times

Conversation

@pujagani
Copy link
Copy Markdown
Contributor

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Related to #11068 .

Motivation and Context

ProtocolHanshake returns a supplier with the same InputStream instance each time for a POST request body. This causes problems when the HttpClient needs to read the POST request body more than once. To ensure multiple reads are allowed, the chances returns a new instance of InputStream each time. The changes are inspired from the Selenium's memoized supplier.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Base: 52.69% // Head: 52.69% // No change to project coverage 👍

Coverage data is based on head (3547e72) compared to base (5f4a05c).
Patch has no changes to coverable lines.

❗ Current head 3547e72 differs from pull request most recent head 265daad. Consider uploading reports for the commit 265daad to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #11249   +/-   ##
=======================================
  Coverage   52.69%   52.69%           
=======================================
  Files          82       82           
  Lines        5545     5545           
  Branches      198      198           
=======================================
  Hits         2922     2922           
  Misses       2425     2425           
  Partials      198      198           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @pujagani!

@diemol diemol merged commit 558e0a0 into SeleniumHQ:trunk Nov 11, 2022
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.

3 participants