richardfogaca commented on code in PR #41004:
URL: https://github.com/apache/superset/pull/41004#discussion_r3414875514
##########
superset-frontend/src/components/StreamingExportModal/useStreamingExport.ts:
##########
@@ -95,17 +98,25 @@ const createFetchRequest = async (
payload: StreamingExportPayload,
filename: string | undefined,
_exportType: string,
+ exportSource: StreamingExportSource | undefined,
expectedRows: number | undefined,
signal: AbortSignal,
): Promise<RequestInit> => {
const headers: Record<string, string> = {
'Content-Type': 'application/x-www-form-urlencoded',
};
- // Get CSRF token using SupersetClient
- const csrfToken = await SupersetClient.getCSRFToken();
- if (csrfToken) {
- headers['X-CSRFToken'] = csrfToken;
+ const guestToken = SupersetClient.getGuestToken();
+ const isGuestTokenChartExport =
+ Boolean(guestToken) &&
+ exportSource === 'chart' &&
+ !('client_id' in payload);
+
+ if (!isGuestTokenChartExport) {
Review Comment:
Added the inline invariant comment in cd329ffea8.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]