We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a950b commit 1b7282aCopy full SHA for 1b7282a
src/services/api/streaming.ts
@@ -28,6 +28,12 @@ export interface StreamQueryOptions {
28
}
29
30
export class StreamingAPI extends BaseYdbAPI {
31
+ private csrfToken?: string;
32
+
33
+ setCSRFToken = (token: string) => {
34
+ this.csrfToken = token;
35
+ };
36
37
async streamQuery<Action extends Actions>(
38
params: StreamQueryParams<Action>,
39
options: StreamQueryOptions,
@@ -48,6 +54,10 @@ export class StreamingAPI extends BaseYdbAPI {
48
54
'Content-Type': 'application/json',
49
55
});
50
56
57
+ if (this.csrfToken) {
58
+ headers.set('X-CSRF-Token', this.csrfToken);
59
+ }
60
51
61
if (params.tracingLevel) {
52
62
headers.set('X-Trace-Verbosity', String(params.tracingLevel));
53
63
0 commit comments