@@ -95,11 +95,11 @@ async def test_websocket_auth_permissive(jp_serverapp, jp_ws_fetch):
95
95
)
96
96
97
97
# should always permit access when `@allow_unauthenticated` is used
98
- ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" })
98
+ ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" , "Cookie" : "" })
99
99
ws .close ()
100
100
101
101
# should allow access when no authentication rules are set up
102
- ws = await jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" })
102
+ ws = await jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" , "Cookie" : "" })
103
103
ws .close ()
104
104
105
105
@@ -117,12 +117,12 @@ async def test_websocket_auth_required(jp_serverapp, jp_ws_fetch):
117
117
)
118
118
119
119
# should always permit access when `@allow_unauthenticated` is used
120
- ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" })
120
+ ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" , "Cookie" : "" })
121
121
ws .close ()
122
122
123
123
# should forbid access when no authentication rules are set up
124
124
with pytest .raises (HTTPClientError ) as exception :
125
- ws = await jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" })
125
+ ws = await jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" , "Cookie" : "" })
126
126
assert exception .value .code == 403
127
127
128
128
@@ -142,7 +142,7 @@ async def test_websocket_auth_respsects_identity_provider(jp_serverapp, jp_ws_fe
142
142
)
143
143
144
144
def fetch ():
145
- return jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" })
145
+ return jp_ws_fetch ("no-rules" , headers = {"Authorization" : "" , "Cookie" : "" })
146
146
147
147
# If no identity provider is set the following request should fail
148
148
# because the default tornado user would not be found:
@@ -186,5 +186,5 @@ async def test_websocket_auth_warns_mixin_lacks_jupyter_handler(jp_serverapp, jp
186
186
JupyterServerAuthWarning ,
187
187
match = "WebSocketMixin sub-class does not inherit from JupyterHandler" ,
188
188
):
189
- ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" })
189
+ ws = await jp_ws_fetch ("permissive" , headers = {"Authorization" : "" , "Cookie" : "" })
190
190
ws .close ()
0 commit comments