-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional headers to every request #167
Comments
I have exactly the same issue. I have also tried: options.Headers.Add({"CF-Access-Client-Secret", "xxxxxx" ); Please tell me if you manage to get a work around working. |
This is actually missing as a feature at the moment. It would just take a small adjustment to |
The new version sems to have solved most of the issues I had, and I can set whatever custom header I need. But for real time channels using the .On(ListenType.All, (sender, change) it seems it isn't sending the header. But I am still trying to locate if it is on client or server side this problem is located. |
Since Realtime goes through Websockets, a header is only sent to establish an initial connection, it wouldn't be sent on every request |
Yes I realized whenever I wrote it. I looked into the realtime module. From what I could tell the ws lib used is https://github.com/Marfusios/websocket-client It has a SetRequestHeader method on ClientWebSocket. But in the realtime module the WebsocketClient is used. I haven't spent the time figuring out the difference. But I just wanted to give me findings on the matter. |
Oh! I apologize - I stand corrected. We actually don't pass any headers to the realtime client. All of the authorization is handled from inside the websocket connection. But that's a feature we can add in. |
…ecifying `GetHeaders` on the `RealtimeClient` which are included on the initial request to the server to establish websocket connection.
Available in 1.1.1 |
I am using the SupabasTables method .On supabase-csharp/Supabase/SupabaseTable.cs Line 43 in 6e2eb32
And it seems to be calling the ConnectAsync() method But it seems like the headers arn't getting applied from my testing. But I might be hitting the limitations of what is possible using headers and RLS. RLS: (current_setting('request.headers'::text, true))::json ->> 'user_api_key'::text |
I have set up a Supabase instance behind Cloudflare. Now I need to pass additional headers with every request. I already tried with the code above. This doesn't seem to be working. Does anyone have an idea how I could achieve this?
The text was updated successfully, but these errors were encountered: