MCPcopy Index your code
hub / github.com/plotly/dash / getCSRFHeader

Function getCSRFHeader

dash/dash-renderer/src/actions/index.js:69–83  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

67const logWarningOnce = once(console.warn);
68
69export function getCSRFHeader(config) {
70 try {
71 const tokenName = (config && config.csrf_token_name) || '_csrf_token';
72 const headerName = (config && config.csrf_header_name) || 'X-CSRFToken';
73 const cookies = cookie.parse(document.cookie);
74 const token = cookies[tokenName];
75 if (!token) {
76 return {};
77 }
78 return {[headerName]: token};
79 } catch (e) {
80 logWarningOnce(e);
81 return {};
82 }
83}
84
85function triggerDefaultState(dispatch, getState) {
86 const {graphs, paths, layout} = getState();

Callers 3

GETFunction · 0.90
POSTFunction · 0.90
fetchCallbackFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…