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
* Ability to specify custom headers for request (#1166)
* Add headers for fetch() method (#1166)
* Update tests for the evaluating headers (#1166)
* Add TS type for headers (#1166)
* Add `headers` to documentation (#1166)
* Add `headers: null` to global options default definition (#1166)
* Describe `options` for transport method (#1166)
Copy file name to clipboardExpand all lines: docs/config.rst
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,12 +269,41 @@ Those configuration options are documented below:
269
269
sentry_key
270
270
Your public client key (DSN).
271
271
272
+
options
273
+
Include all top-level options described.
274
+
272
275
onSuccess
273
276
Callback to be invoked upon a successful request.
274
277
275
278
onError
276
279
Callback to be invoked upon a failed request.
277
280
281
+
.. describe:: headers
282
+
283
+
Pass custom headers to server requests for ``fetch`` or ``XMLHttpRequest``.
284
+
285
+
.. code-block:: javascript
286
+
287
+
{
288
+
headers: {
289
+
'CSRF-TOKEN':'12345'
290
+
}
291
+
}
292
+
293
+
Headers value can be in form of a function, to compute value in time of a request:
294
+
295
+
.. code-block:: javascript
296
+
297
+
{
298
+
headers: {
299
+
'CSRF-TOKEN':function() {
300
+
// custom logic that will be computed on every request
301
+
returnnewDate();
302
+
}
303
+
}
304
+
}
305
+
306
+
278
307
.. describe:: allowDuplicates
279
308
280
309
By default, Raven.js attempts to suppress duplicate captured errors and messages that occur back-to-back. Such events are often triggered by rogue code (e.g. from a `setInterval` callback in a browser extension), are not actionable, and eat up your event quota.
0 commit comments