Skip to content

Commit 3482361

Browse files
committed
- reverts status code changes
1 parent 3be4c4b commit 3482361

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/microsoft/graph/core/requests/upload/UploadResponseHandler.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ public <T extends Parsable> UploadResult<T> handleResponse(@Nonnull final Respon
5656
}
5757
try(final InputStream in = body.byteStream()){
5858
final String contentType = body.contentType().toString().split(";")[0]; //contentType.toString() returns in format <mediaType>;<charset>, we only want the mediaType.
59-
int responseCode = response.code();
6059
if(!response.isSuccessful()) {
6160
throw new ApiExceptionBuilder()
6261
.withMessage(ErrorConstants.Codes.GENERAL_EXCEPTION)
63-
.withResponseStatusCode(responseCode)
62+
.withResponseStatusCode(response.code())
6463
.withResponseHeaders(HeadersCompatibility.getResponseHeaders(response.headers()))
6564
.build();
6665
}
6766
UploadResult<T> uploadResult = new UploadResult<>();
68-
if (responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_OK) {
67+
if (response.code() == HttpURLConnection.HTTP_CREATED) {
6968
if (body.contentLength() > 0) {
7069
final ParseNode uploadTypeParseNode = parseNodeFactory.getParseNode(contentType, in);
7170
uploadResult.itemResponse = uploadTypeParseNode.getObjectValue(factory);

0 commit comments

Comments
 (0)