mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
add withCredentials config option
This commit is contained in:
parent
5f72dfead6
commit
f7a48f5a32
@ -49,6 +49,7 @@ return (function () {
|
|||||||
swappingClass:'htmx-swapping',
|
swappingClass:'htmx-swapping',
|
||||||
allowEval:true,
|
allowEval:true,
|
||||||
attributesToSettle:["class", "style", "width", "height"],
|
attributesToSettle:["class", "style", "width", "height"],
|
||||||
|
withCredentials:false,
|
||||||
wsReconnectDelay: 'full-jitter',
|
wsReconnectDelay: 'full-jitter',
|
||||||
disableSelector: "[hx-disable], [data-hx-disable]",
|
disableSelector: "[hx-disable], [data-hx-disable]",
|
||||||
},
|
},
|
||||||
@ -2145,6 +2146,7 @@ return (function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
xhr.overrideMimeType("text/html");
|
xhr.overrideMimeType("text/html");
|
||||||
|
xhr.withCredentials = htmx.config.withCredentials;
|
||||||
|
|
||||||
// request headers
|
// request headers
|
||||||
for (var header in headers) {
|
for (var header in headers) {
|
||||||
|
@ -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
|
* `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
|
* `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
|
* `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`
|
* `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
|
##### Example
|
||||||
|
Loading…
x
Reference in New Issue
Block a user