Browse Source

fix: webrequest api typings (#21038)

* fix: webrequest api typings

* Update web-request.md
Robo 5 years ago
parent
commit
8dd004235b
1 changed files with 5 additions and 4 deletions
  1. 5 4
      docs/api/web-request.md

+ 5 - 4
docs/api/web-request.md

@@ -101,14 +101,14 @@ Some examples of valid `urls`:
   * `callback` Function
     * `response` Object
       * `cancel` Boolean (optional)
-      * `requestHeaders` Record<string, string> (optional) - When provided, request will be made
+      * `requestHeaders` Record<string, string | string[]> (optional) - When provided, request will be made
   with these headers.
 
 The `listener` will be called with `listener(details, callback)` before sending
 an HTTP request, once the request headers are available. This may occur after a
 TCP connection is made to the server, but before any http data is sent.
 
-The `callback` has to be called with an `response` object.
+The `callback` has to be called with a `response` object.
 
 #### `webRequest.onSendHeaders([filter, ]listener)`
 
@@ -150,7 +150,7 @@ response are visible by the time this listener is fired.
   * `callback` Function
     * `response` Object
       * `cancel` Boolean (optional)
-      * `responseHeaders` Record<string, string> (optional) - When provided, the server is assumed
+      * `responseHeaders` Record<string, string | string[]> (optional) - When provided, the server is assumed
         to have responded with these headers.
       * `statusLine` String (optional) - Should be provided when overriding
         `responseHeaders` to change header status otherwise original response
@@ -159,7 +159,7 @@ response are visible by the time this listener is fired.
 The `listener` will be called with `listener(details, callback)` when HTTP
 response headers of a request have been received.
 
-The `callback` has to be called with an `response` object.
+The `callback` has to be called with a `response` object.
 
 #### `webRequest.onResponseStarted([filter, ]listener)`
 
@@ -201,6 +201,7 @@ and response headers are available.
     * `timestamp` Double
     * `redirectURL` String
     * `statusCode` Integer
+    * `statusLine` String
     * `ip` String (optional) - The server IP address that the request was
       actually sent to.
     * `fromCache` Boolean