Skip to content

Commit 41bafdb

Browse files
authored
Merge pull request #1109 from microsoft/bugfix/content-length
- adds default clause for content length logic
2 parents 3486a8e + 7892120 commit 41bafdb

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
## [1.0.6] - 2023-03-04
15+
16+
### Changed
17+
18+
- Fixed a regression with the content length request header from 1.0.5.
19+
1420
## [1.0.5] - 2023-02-28
1521

1622
### Changed

components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ public MediaType contentType() {
901901
}
902902

903903
@Override
904-
public long contentLength() {
904+
public long contentLength() throws IOException {
905905
long length;
906906
final Set<String> contentLength =
907907
requestInfo.headers.getOrDefault(
@@ -917,6 +917,9 @@ public long contentLength() {
917917
Long.parseLong(
918918
contentLength.toArray(new String[] {})[0]);
919919
}
920+
if (length <= 0) {
921+
length = super.contentLength();
922+
}
920923
if (length > 0) {
921924
spanForAttributes.setAttribute(
922925
SemanticAttributes.HTTP_REQUEST_BODY_SIZE, length);

components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public UserAgentHandlerOption() {}
1313

1414
private boolean enabled = true;
1515
@Nonnull private String productName = "kiota-java";
16-
@Nonnull private String productVersion = "1.0.5";
16+
@Nonnull private String productVersion = "1.0.6";
1717

1818
/**
1919
* Gets the product name to be used in the user agent header

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ org.gradle.caching=true
2626
mavenGroupId = com.microsoft.kiota
2727
mavenMajorVersion = 1
2828
mavenMinorVersion = 0
29-
mavenPatchVersion = 5
29+
mavenPatchVersion = 6
3030
mavenArtifactSuffix =
3131

3232
#These values are used to run functional tests

0 commit comments

Comments
 (0)