We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 530f8a0 commit 7289c4bCopy full SHA for 7289c4b
.changeset/flat-results-divide.md
@@ -0,0 +1,6 @@
1
+---
2
+"@gradio/client": minor
3
+"gradio": minor
4
5
+
6
+feat:Add credentials: include and Cookie header to prevent 401 error
client/js/src/client.ts
@@ -67,9 +67,16 @@ export class Client {
67
}
68
69
stream(url: URL): EventSource {
70
+ const headers = new Headers();
71
+ if (this && this.cookies) {
72
+ headers.append("Cookie", this.cookies);
73
+ }
74
75
this.abort_controller = new AbortController();
76
77
this.stream_instance = readable_stream(url.toString(), {
78
+ credentials: "include",
79
+ headers: headers,
80
signal: this.abort_controller.signal
81
});
82
0 commit comments