@@ -3,7 +3,9 @@ import { h1NoCache, noCache, createUrl, AbortController, AbortError, FetchError
3
3
import { serialize as serializeCookie , parse as parseCookie } from 'cookie' ;
4
4
import log from '../logging.js' ;
5
5
6
- // TODO: review, use keepAliveNoCache, review keepAlive: true (default in many options).
6
+ const h1_options = {
7
+ alpnProtocols : [ ALPN_HTTP1_1 ]
8
+ }
7
9
8
10
const fetchKeepAlive = noCache ( {
9
11
h1 : {
@@ -15,14 +17,16 @@ const fetchKeepAlive = noCache({
15
17
rejectUnauthorized : false // By default skip auth check for all.
16
18
} ) . fetch ;
17
19
18
- const fetchH1KeepAlive = h1NoCache ( {
20
+ const fetchH1KeepAlive = noCache ( {
21
+ ...h1_options ,
19
22
h1 : {
20
23
keepAlive : true
21
24
} ,
22
25
rejectUnauthorized : false // By default skip auth check for all.
23
26
} ) . fetch ;
24
27
25
- const fetchIPv4H1KeepAlive = h1NoCache ( {
28
+ const fetchIPv4H1KeepAlive = noCache ( {
29
+ ...h1_options ,
26
30
h1 : {
27
31
keepAlive : true ,
28
32
family : 4
@@ -38,7 +42,8 @@ const fetchAuthorized = noCache({
38
42
39
43
const fetchH1Authorized = h1NoCache ( ) . fetch ; // `rejectUnauthorized: true` - by `fetch` default.
40
44
41
- const fetchIPv4H1Authorized = h1NoCache ( {
45
+ const fetchIPv4H1Authorized = noCache ( {
46
+ ...h1_options ,
42
47
h1 : {
43
48
keepAlive : true ,
44
49
family : 4
@@ -56,9 +61,10 @@ const fetchH1 = h1NoCache({
56
61
rejectUnauthorized : false // By default skip auth check for all.
57
62
} ) . fetch ;
58
63
59
- const fetchIPv4H1 = h1NoCache ( {
64
+ const fetchIPv4H1 = noCache ( {
65
+ ...h1_options ,
60
66
h1 : {
61
- keepAlive : false , // Default from `h1NoCache`.
67
+ keepAlive : false ,
62
68
family : 4
63
69
} ,
64
70
rejectUnauthorized : false // By default skip auth check for all.
0 commit comments