Skip to content

Commit c745544

Browse files
authored
Fix truncated header value
In case of ranged request, the response headers looks like this: --34a80522-fb29-4887-ab36-6d20ac045936 Content-Type: application/http; msgtype=response HTTP/1.1 206 Partial Content Accept-Ranges: Item Access-Control-Allow-Origin: * Access-Control-Expose-Headers: Content-Range Content-Type: application/json; charset=utf-8 Content-Range: Item 0-19/56 The current code just split for ' ' (space) and take the only first part of the value (here "Item" instead of "Item 0-19/56"). The fix just take the rest (not the headers name) of the line.
1 parent 8f1a470 commit c745544

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/adapters/http-multipart-mixed-boundary-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class HttpMultipartMixedBoundaryAdapter implements IBatchHttpRequestAdapt
120120
status = parseInt(lineParts[1], 10);
121121
statusText = lineParts.slice(2).join(HttpMultipartMixedBoundaryAdapter.SPACE);
122122
} else {
123-
headers.append(lineParts[0].replace(":", HttpMultipartMixedBoundaryAdapter.EMPTY_STRING), lineParts[1]);
123+
headers.append(lineParts[0].replace(":", HttpMultipartMixedBoundaryAdapter.EMPTY_STRING), header.substring(header.indexOf(HttpMultipartMixedBoundaryAdapter.SPACE)+1));
124124
}
125125
});
126126

0 commit comments

Comments
 (0)