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

Decompress response body string if it was compressed #59

Merged
merged 1 commit into from
Feb 10, 2023
Merged

Conversation

rmstar
Copy link
Contributor

@rmstar rmstar commented Feb 10, 2023

  • getResponseBodyAsString() now returns uncompressed data if response was compressed using gzip or deflate
  • Added new API getUncompressedResponseBody() that returns uncompressed response as bytes if it was response was compressed
  • Upgraded checkstyle version (now using same version as cdap repo) and fixed checkstyle issues

Copy link
Contributor

@tivv tivv left a comment

Choose a reason for hiding this comment

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

Also please add a unit test

@@ -22,7 +22,7 @@ the License.
<parent>
<artifactId>common</artifactId>
<groupId>io.cdap.common</groupId>
<version>0.13.0-SNAPSHOT</version>
<version>0.13.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put "-SNAPSHOT until after released

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted

throw new IllegalStateException(String.format("Failed to decompress %s encoded response body", encoding), e);
}

throw new IllegalArgumentException("Unsupported content encoding " + encoding);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use IllegalStateException as it's not an argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@rmstar
Copy link
Contributor Author

rmstar commented Feb 10, 2023

Also please add a unit test

added test

@rmstar rmstar merged commit 15d6bcb into develop Feb 10, 2023
rmstar added a commit that referenced this pull request Feb 11, 2023
@itsankit-google itsankit-google deleted the uncompress branch September 13, 2024 12:15
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