You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1087,6 +1087,20 @@ Allows to intercept [HTTP request options](https://github.com/sindresorhus/got#o
1087
1087
(RequestOptions) => RequestOptions
1088
1088
```
1089
1089
1090
+
In runtime a unique `X-Request-ID` header is generated for each browser request which consists of `${FIRST_X_REQ_ID}__${LAST_X_REQ_ID}`, where:
1091
+
-`FIRST_X_REQ_ID` - unique uuid for each test (different for each retry), allows to find all requests related to a single test run;
1092
+
-`LAST_X_REQ_ID` - unique uuid for each browser request, allows to find one unique request in one test (together with `FIRST_X_REQ_ID`).
1093
+
1094
+
Header `X-Request-ID` can be useful if you manage the cloud with browsers yourself and collect logs with requests. Real-world example: `2f31ffb7-369d-41f4-bbb8-77744615d2eb__e8d011d8-bb76-42b9-b80e-02f03b8d6fe1`.
1095
+
1096
+
To override generated `X-Request-ID` to your own value you need specify it in `transformRequest` handler. Example:
1097
+
1098
+
```javascript
1099
+
transformRequest: (req) => {
1100
+
req.handler["X-Request-ID"] ="my_x_req_id";
1101
+
}
1102
+
```
1103
+
1090
1104
#### transformResponse
1091
1105
Allows to intercept [HTTP response object](https://github.com/sindresorhus/got#response) after a WebDriver response has arrived. Default value is `null`. If function is passed then it takes `Response` (original response object) as the first and `RequestOptions` as the second argument. Should return modified `Response`. Example:
0 commit comments