File tree 5 files changed +33
-2
lines changed
src/core/request/response
5 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ Changelog
11
11
12
12
_ Note: Gaps between patch versions are faulty, broken or test releases._
13
13
14
+ ## v3.101.2 (2024-12-09)
15
+
16
+ #### :bug : Bug Fix
17
+
18
+ * Fixed an issue when receiving an empty string with the ` Content-Type: application/octet-stream ` header ` core/request/response `
19
+
14
20
## v3.101.1 (2024-10-21)
15
21
16
22
#### :bug : Bug Fix
Original file line number Diff line number Diff line change 5
5
"main" : " lib/core/index.js" ,
6
6
"typings" : " index.d.ts" ,
7
7
"license" : " MIT" ,
8
- "version" : " 3.101.1 " ,
8
+ "version" : " 3.101.2 " ,
9
9
"author" :
" kobezzza <[email protected] > (https://github.com/kobezzza)" ,
10
10
"repository" : {
11
11
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ Changelog
9
9
> - :house : [ Internal]
10
10
> - :nail_care : [ Polish]
11
11
12
+ ## v3.101.2 (2024-12-09)
13
+
14
+ #### :bug : Bug Fix
15
+
16
+ * Fixed an issue when receiving an empty string with the ` Content-Type: application/octet-stream ` header ` core/request/response `
17
+
12
18
## v3.93.0 (2023-03-14)
13
19
14
20
#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -664,7 +664,7 @@ export default class Response<
664
664
@once
665
665
arrayBuffer ( ) : AbortablePromise < ArrayBuffer > {
666
666
return this . readBody ( ) . then ( ( body ) => {
667
- if ( body == null ) {
667
+ if ( body == null || body === '' ) {
668
668
return new ArrayBuffer ( 0 ) ;
669
669
}
670
670
Original file line number Diff line number Diff line change
1
+ import { Response } from 'core/request' ;
2
+ import V4Headers from 'core/request/headers' ;
3
+
4
+ describe ( 'core/request/response' , ( ) => {
5
+ test ( [
6
+ 'should successfully handle a request with the Content-Type: application/octet-stream header' ,
7
+ 'and an empty response body'
8
+ ] . join ( ' ' ) , async ( ) => {
9
+
10
+ const response = new Response ( Promise . resolve ( '' ) , {
11
+ url : 'url/url' ,
12
+ headers : new V4Headers ( {
13
+ 'Content-Type' : 'application/octet-stream'
14
+ } )
15
+ } ) ;
16
+
17
+ await expect ( response . decode ( ) ) . resolves . toBeInstanceOf ( ArrayBuffer ) ;
18
+ } ) ;
19
+ } ) ;
You can’t perform that action at this time.
0 commit comments