add withCredentials config option

This commit is contained in:
Landlocked Surfer 2021-05-05 21:26:39 +02:00
parent 5f72dfead6
commit f7a48f5a32
2 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,7 @@ return (function () {
swappingClass:'htmx-swapping',
allowEval:true,
attributesToSettle:["class", "style", "width", "height"],
withCredentials:false,
wsReconnectDelay: 'full-jitter',
disableSelector: "[hx-disable], [data-hx-disable]",
},
@ -2145,6 +2146,7 @@ return (function () {
}
xhr.overrideMimeType("text/html");
xhr.withCredentials = htmx.config.withCredentials;
// request headers
for (var header in headers) {

View File

@ -98,6 +98,7 @@ Note that using a [meta tag](/docs/#config) is the preferred mechanism for setti
* `settlingClass:'htmx-settling'` - string: the class to place on target elements when htmx is in the settling phase
* `swappingClass:'htmx-swapping'` - string: the class to place on target elements when htmx is in the swapping phase
* `allowEval:true` - boolean: allows the use of eval-like functionality in htmx, to enable `hx-vars`, trigger conditions & script tag evaluation. Can be set to `false` for CSP compatibility
* `withCredentials:false` - boolean: allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates
* `wsReconnectDelay:full-jitter` - string/function: the default implementation of `getWebSocketReconnectDelay` for reconnecting after unexpected connection loss by the event code `Abnormal Closure`, `Service Restart` or `Try Again Later`
##### Example