Skip to content

Commit

Permalink
Merge pull request #1109 from microsoft/bugfix/content-length
Browse files Browse the repository at this point in the history
- adds default clause for content length logic
  • Loading branch information
baywet authored Mar 4, 2024
2 parents 3486a8e + 7892120 commit 41bafdb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [1.0.6] - 2023-03-04

### Changed

- Fixed a regression with the content length request header from 1.0.5.

## [1.0.5] - 2023-02-28

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ public MediaType contentType() {
}

@Override
public long contentLength() {
public long contentLength() throws IOException {
long length;
final Set<String> contentLength =
requestInfo.headers.getOrDefault(
Expand All @@ -917,6 +917,9 @@ public long contentLength() {
Long.parseLong(
contentLength.toArray(new String[] {})[0]);
}
if (length <= 0) {
length = super.contentLength();
}
if (length > 0) {
spanForAttributes.setAttribute(
SemanticAttributes.HTTP_REQUEST_BODY_SIZE, length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public UserAgentHandlerOption() {}

private boolean enabled = true;
@Nonnull private String productName = "kiota-java";
@Nonnull private String productVersion = "1.0.5";
@Nonnull private String productVersion = "1.0.6";

/**
* Gets the product name to be used in the user agent header
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ org.gradle.caching=true
mavenGroupId = com.microsoft.kiota
mavenMajorVersion = 1
mavenMinorVersion = 0
mavenPatchVersion = 5
mavenPatchVersion = 6
mavenArtifactSuffix =

#These values are used to run functional tests
Expand Down

0 comments on commit 41bafdb

Please sign in to comment.