Skip to content

Commit fac4495

Browse files
committed
Try with empty cookie
1 parent 4265f4e commit fac4495

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/base/test_websocket.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ async def test_websocket_auth_permissive(jp_serverapp, jp_ws_fetch):
9595
)
9696

9797
# 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": ""})
9999
ws.close()
100100

101101
# 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": ""})
103103
ws.close()
104104

105105

@@ -117,12 +117,12 @@ async def test_websocket_auth_required(jp_serverapp, jp_ws_fetch):
117117
)
118118

119119
# 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": ""})
121121
ws.close()
122122

123123
# should forbid access when no authentication rules are set up
124124
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": ""})
126126
assert exception.value.code == 403
127127

128128

@@ -142,7 +142,7 @@ async def test_websocket_auth_respsects_identity_provider(jp_serverapp, jp_ws_fe
142142
)
143143

144144
def fetch():
145-
return jp_ws_fetch("no-rules", headers={"Authorization": ""})
145+
return jp_ws_fetch("no-rules", headers={"Authorization": "", "Cookie": ""})
146146

147147
# If no identity provider is set the following request should fail
148148
# 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
186186
JupyterServerAuthWarning,
187187
match="WebSocketMixin sub-class does not inherit from JupyterHandler",
188188
):
189-
ws = await jp_ws_fetch("permissive", headers={"Authorization": ""})
189+
ws = await jp_ws_fetch("permissive", headers={"Authorization": "", "Cookie": ""})
190190
ws.close()

0 commit comments

Comments
 (0)