|
1 | 1 | type http = [ | `Http]; |
2 | 2 |
|
3 | | - type headers = pri { |
| 3 | +type headers = |
| 4 | + pri { |
4 | 5 | accept: option(string), |
5 | | - [@bs.as "accept-language"] acceptLanguage: option(string), |
6 | | - [@bs.as "accept-patch"] acceptPatch: option(string), |
7 | | - [@bs.as "accept-ranges"] acceptRanges: option(string), |
8 | | - [@bs.as "access-control-allow-credentials"] accessControlAllowCredentials: option(string), |
9 | | - [@bs.as "access-control-allow-headers"] accessControlAllowHeaders: option(string), |
10 | | - [@bs.as "access-control-allow-methods"] accessControlAllowMethods: (string), |
11 | | - [@bs.as "access-control-allow-origin"] accessControlAllowOrigin: option(string), |
12 | | - [@bs.as "access-control-expose-headers"] accessControlExposeHeaders: option(string), |
13 | | - [@bs.as "access-control-max-age"] accessControlMaxAge: option(string), |
| 6 | + [@bs.as "accept-language"] |
| 7 | + acceptLanguage: option(string), |
| 8 | + [@bs.as "accept-patch"] |
| 9 | + acceptPatch: option(string), |
| 10 | + [@bs.as "accept-ranges"] |
| 11 | + acceptRanges: option(string), |
| 12 | + [@bs.as "access-control-allow-credentials"] |
| 13 | + accessControlAllowCredentials: option(string), |
| 14 | + [@bs.as "access-control-allow-headers"] |
| 15 | + accessControlAllowHeaders: option(string), |
| 16 | + [@bs.as "access-control-allow-methods"] |
| 17 | + accessControlAllowMethods: string, |
| 18 | + [@bs.as "access-control-allow-origin"] |
| 19 | + accessControlAllowOrigin: option(string), |
| 20 | + [@bs.as "access-control-expose-headers"] |
| 21 | + accessControlExposeHeaders: option(string), |
| 22 | + [@bs.as "access-control-max-age"] |
| 23 | + accessControlMaxAge: option(string), |
14 | 24 | age: option(string), |
15 | 25 | allow: option(string), |
16 | | - [@bs.as "alt-svc"] altSvc: option(string), |
| 26 | + [@bs.as "alt-svc"] |
| 27 | + altSvc: option(string), |
17 | 28 | authorization: option(string), |
18 | | - [@bs.as "cache-control"] cacheControl: option(string), |
| 29 | + [@bs.as "cache-control"] |
| 30 | + cacheControl: option(string), |
19 | 31 | connection: option(string), |
20 | | - [@bs.as "content-disposition"] contentDisposition: option(string), |
21 | | - [@bs.as "content-encoding"] contentEncoding: option(string), |
22 | | - [@bs.as "content-language"] contentLanguage: option(string), |
23 | | - [@bs.as "content-length"] contentLenth: option(string), |
24 | | - [@bs.as "content-location"] contentLocation: option(string), |
25 | | - [@bs.as "content-range"] contentRange: option(string), |
26 | | - [@bs.as "content-type"] contentType: option(string), |
| 32 | + [@bs.as "content-disposition"] |
| 33 | + contentDisposition: option(string), |
| 34 | + [@bs.as "content-encoding"] |
| 35 | + contentEncoding: option(string), |
| 36 | + [@bs.as "content-language"] |
| 37 | + contentLanguage: option(string), |
| 38 | + [@bs.as "content-length"] |
| 39 | + contentLenth: option(string), |
| 40 | + [@bs.as "content-location"] |
| 41 | + contentLocation: option(string), |
| 42 | + [@bs.as "content-range"] |
| 43 | + contentRange: option(string), |
| 44 | + [@bs.as "content-type"] |
| 45 | + contentType: option(string), |
27 | 46 | cookie: option(string), |
28 | 47 | date: option(string), |
29 | 48 | expect: option(string), |
30 | 49 | expires: option(string), |
31 | 50 | forwarded: option(string), |
32 | 51 | from: option(string), |
33 | 52 | host: option(string), |
34 | | - [@bs.as "if-match"] ifMatch: option(string), |
35 | | - [@bs.as "if-modified-since"] ifModifiedSince: option(string), |
36 | | - [@bs.as "if-none-match"] ifNoneMatch: option(string), |
37 | | - [@bs.as "if-unmodified-since"] ifUnmodifiedSince: option(string), |
38 | | - [@bs.as "last-modified"] lastModified: option(string), |
| 53 | + [@bs.as "if-match"] |
| 54 | + ifMatch: option(string), |
| 55 | + [@bs.as "if-modified-since"] |
| 56 | + ifModifiedSince: option(string), |
| 57 | + [@bs.as "if-none-match"] |
| 58 | + ifNoneMatch: option(string), |
| 59 | + [@bs.as "if-unmodified-since"] |
| 60 | + ifUnmodifiedSince: option(string), |
| 61 | + [@bs.as "last-modified"] |
| 62 | + lastModified: option(string), |
39 | 63 | location: option(string), |
40 | 64 | pragma: option(string), |
41 | | - [@bs.as "proxy-authenticate"] proxyAuthenticate: option(string), |
42 | | - [@bs.as "proxy-authorization"] proxyAuthorization: option(string), |
43 | | - [@bs.as "public-key-pins"] publicKeyPins: option(string), |
| 65 | + [@bs.as "proxy-authenticate"] |
| 66 | + proxyAuthenticate: option(string), |
| 67 | + [@bs.as "proxy-authorization"] |
| 68 | + proxyAuthorization: option(string), |
| 69 | + [@bs.as "public-key-pins"] |
| 70 | + publicKeyPins: option(string), |
44 | 71 | range: option(string), |
45 | 72 | referer: option(string), |
46 | | - [@bs.as "retry-after"] retryAfter: option(string), |
47 | | - [@bs.as "set-cookie"] setCookie: option(array(string)), |
48 | | - [@bs.as "strict-transport-security"] strictTransportPolicy: option(string), |
| 73 | + [@bs.as "retry-after"] |
| 74 | + retryAfter: option(string), |
| 75 | + [@bs.as "set-cookie"] |
| 76 | + setCookie: option(array(string)), |
| 77 | + [@bs.as "strict-transport-security"] |
| 78 | + strictTransportPolicy: option(string), |
49 | 79 | tk: option(string), |
50 | 80 | trailer: option(string), |
51 | | - [@bs.as "transfer-encoding"] transferEncoding: option(string), |
| 81 | + [@bs.as "transfer-encoding"] |
| 82 | + transferEncoding: option(string), |
52 | 83 | upgrade: option(string), |
53 | | - [@bs.as "user-agent"] userAgent: option(string), |
| 84 | + [@bs.as "user-agent"] |
| 85 | + userAgent: option(string), |
54 | 86 | vary: option(string), |
55 | 87 | via: option(string), |
56 | 88 | warning: option(string), |
57 | | - [@bs.as "www-authenticate"] wwwAuthenticate: option(string), |
| 89 | + [@bs.as "www-authenticate"] |
| 90 | + wwwAuthenticate: option(string), |
58 | 91 | }; |
59 | 92 |
|
60 | 93 | module IncomingMessage = { |
@@ -125,8 +158,7 @@ module IncomingMessage = { |
125 | 158 | [@bs.get] external method_: subtype('w, 'r, 'a) => string = "method"; |
126 | 159 | [@bs.get] external url: subtype('w, 'r, 'a) => string = "url"; |
127 | 160 | [@bs.get] external port: subtype('w, 'r, 'a) => int = "port"; |
128 | | - [@bs.get] |
129 | | - external headers: subtype('w, 'r, 'a) => headers = "headers"; |
| 161 | + [@bs.get] external headers: subtype('w, 'r, 'a) => headers = "headers"; |
130 | 162 | [@bs.get] |
131 | 163 | external rawHeaders: subtype('w, 'r, 'a) => array(string) = "rawHeaders"; |
132 | 164 | [@bs.get] |
@@ -172,7 +204,7 @@ module ClientRequest = { |
172 | 204 | httpVersionMinor: int, |
173 | 205 | statusCode: int, |
174 | 206 | statusMessage: string, |
175 | | - headers: headers, |
| 207 | + headers, |
176 | 208 | rawHeaders: array(string), |
177 | 209 | }; |
178 | 210 | module Events = { |
|
0 commit comments