You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,11 +56,21 @@ The `self.router` attribute has several sub-attributes that provide various info
45
56
*`session_id`: The ID associated with the client's websocket connection. Each tab has a unique session ID.
46
57
*`client_ip`: The IP address of the client. Many users may share the same IP address.
47
58
48
-
*`router.headers`: a selection of common headers associated with the websocket
49
-
connection. These values can only change when the websocket is re-established
50
-
(for example, during page refresh). All other headers are available in the
51
-
dictionary `self.router_data.headers`.
59
+
*`router.headers`: headers associated with the websocket connection. These values can only change when the websocket is re-established (for example, during page refresh).
52
60
*`host`: The hostname and port serving the websocket (backend).
61
+
*`origin`: The origin of the request.
62
+
*`upgrade`: The upgrade header for websocket connections.
63
+
*`connection`: The connection header.
64
+
*`cookie`: The cookie header.
65
+
*`pragma`: The pragma header.
66
+
*`cache_control`: The cache control header.
67
+
*`user_agent`: The user agent string of the client.
68
+
*`sec_websocket_version`: The websocket version.
69
+
*`sec_websocket_key`: The websocket key.
70
+
*`sec_websocket_extensions`: The websocket extensions.
71
+
*`accept_encoding`: The accepted encodings.
72
+
*`accept_language`: The accepted languages.
73
+
*`raw_headers`: A mapping of all HTTP headers as a frozen dictionary. This provides access to any header that was sent with the request, not just the common ones listed above.
53
74
54
75
### Example Values on this Page
55
76
@@ -74,3 +95,22 @@ rx.table.root(
74
95
margin_y="1em",
75
96
)
76
97
```
98
+
99
+
### Accessing Raw Headers
100
+
101
+
The `raw_headers` attribute provides access to all HTTP headers as a frozen dictionary. This is useful when you need to access headers that are not explicitly defined in the `HeaderData` class:
This is particularly useful for accessing custom headers or when working with specific HTTP headers that are not part of the standard set exposed as direct attributes.
0 commit comments