Skip to content
Myr

test_redirects.py

This file

Path

tests/client/test_redirects.py

269 lines · 10.2 KiB · Python

Last changed by

Tighten up response.next() (#297)Florimond Mancabefore adoptiona464627

History of this file

Take it

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 1–5why, one step back
1import json
2from urllib.parse import parse_qs34import pytest5

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 6why, one step back
6from httpx import (

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 7why, one step back
7 URL,

Merge pull request #58 from encode/sync-by-defaultTom Christiebefore adoptionb6c27f0

line 8why, one step back
8 AsyncClient,

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

lines 9–11why, one step back
9 AsyncDispatcher,
10 AsyncRequest,11 AsyncResponse,

Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041

line 12why, one step back
12 CertTypes,

Tighten up response.next() (#297)Florimond Mancabefore adoptiona464627

line 13why, one step back
13 NotRedirectResponse,

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 14–15why, one step back
14 RedirectBodyUnavailable,
15 RedirectLoop,

Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041

line 16why, one step back
16 TimeoutTypes,

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 17why, one step back
17 TooManyRedirects,

Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041

line 18why, one step back
18 VerifyTypes,

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 19–22why, one step back
19 codes,
20)2122

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 23why, one step back
23class MockDispatch(AsyncDispatcher):

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 24–25why, one step back
24 async def send(
25 self,

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 26why, one step back
26 request: AsyncRequest,

Work on bringing API into parity with `requests`. (#76)Tom Christiebefore adoption9574041

lines 27–29why, one step back
27 verify: VerifyTypes = None,
28 cert: CertTypes = None,29 timeout: TimeoutTypes = None,

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 30why, one step back
30 ) -> AsyncResponse:

Tighten up response.next() (#297)Florimond Mancabefore adoptiona464627

lines 31–34why, one step back
31 if request.url.path == "/no_redirect":
32 return AsyncResponse(codes.OK, request=request)3334 elif request.url.path == "/redirect_301":

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 35why, one step back
35 status_code = codes.MOVED_PERMANENTLY

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 36why, one step back
36 headers = {"location": "https://example.org/"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 37why, one step back
37 return AsyncResponse(status_code, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 38–39why, one step back
38
39 elif request.url.path == "/redirect_302":

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 40why, one step back
40 status_code = codes.FOUND

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 41why, one step back
41 headers = {"location": "https://example.org/"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 42why, one step back
42 return AsyncResponse(status_code, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 43–44why, one step back
43
44 elif request.url.path == "/redirect_303":

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 45why, one step back
45 status_code = codes.SEE_OTHER

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 46why, one step back
46 headers = {"location": "https://example.org/"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 47why, one step back
47 return AsyncResponse(status_code, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 48–50why, one step back
48
49 elif request.url.path == "/relative_redirect":50 headers = {"location": "/"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 51why, one step back
51 return AsyncResponse(codes.SEE_OTHER, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 52–54why, one step back
52
53 elif request.url.path == "/no_scheme_redirect":54 headers = {"location": "//example.org/"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 55why, one step back
55 return AsyncResponse(codes.SEE_OTHER, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 56–60why, one step back
56
57 elif request.url.path == "/multiple_redirects":58 params = parse_qs(request.url.query)59 count = int(params.get("count", "0")[0])60 redirect_count = count - 1

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 61why, one step back
61 code = codes.SEE_OTHER if count else codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 62–65why, one step back
62 location = "/multiple_redirects"
63 if redirect_count:64 location += "?count=" + str(redirect_count)65 headers = {"location": location} if count else {}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 66why, one step back
66 return AsyncResponse(code, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 67–69why, one step back
67
68 if request.url.path == "/redirect_loop":69 headers = {"location": "/redirect_loop"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 70why, one step back
70 return AsyncResponse(codes.SEE_OTHER, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 71–73why, one step back
71
72 elif request.url.path == "/cross_domain":73 headers = {"location": "https://example.org/cross_domain_target"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 74why, one step back
74 return AsyncResponse(codes.SEE_OTHER, headers=headers, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 75–78why, one step back
75
76 elif request.url.path == "/cross_domain_target":77 headers = dict(request.headers.items())78 content = json.dumps({"headers": headers}).encode()

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 79why, one step back
79 return AsyncResponse(codes.OK, content=content, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 80–83why, one step back
80
81 elif request.url.path == "/redirect_body":82 await request.read()83 headers = {"location": "/redirect_body_target"}

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

lines 84–86why, one step back
84 return AsyncResponse(
85 codes.PERMANENT_REDIRECT, headers=headers, request=request86 )

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 87–90why, one step back
87
88 elif request.url.path == "/redirect_body_target":89 content = await request.read()90 body = json.dumps({"body": content.decode()}).encode()

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 91why, one step back
91 return AsyncResponse(codes.OK, content=body, request=request)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 92why, one step back
92

Remove "Host" header on redirects if URL origin has changed (#199)Yeray Diaz Diazbefore adoption95dad24

lines 93–103why, one step back
93 elif request.url.path == "/cross_subdomain":
94 if request.headers["host"] != "www.example.org":95 headers = {"location": "https://www.example.org/cross_subdomain"}96 return AsyncResponse(97 codes.PERMANENT_REDIRECT, headers=headers, request=request98 )99 else:100 return AsyncResponse(101 codes.OK, content=b"Hello, world!", request=request102 )103

Sync or Async dispatch (#83)Tom Christiebefore adoption0cbf3c7

line 104why, one step back
104 return AsyncResponse(codes.OK, content=b"Hello, world!", request=request)

Tighten up response.next() (#297)Florimond Mancabefore adoptiona464627

lines 105–113why, one step back
105
106107async def test_no_redirect(backend):108 client = AsyncClient(dispatch=MockDispatch(), backend=backend)109 url = "https://example.com/no_redirect"110 response = await client.get(url)111 assert response.status_code == 200112 with pytest.raises(NotRedirectResponse):113 await response.next()

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 114–115why, one step back
114
115

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 116–117why, one step back
116async def test_redirect_301(backend):
117 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 118why, one step back
118 response = await client.post("https://example.org/redirect_301")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 119why, one step back
119 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 120–123why, one step back
120 assert response.url == URL("https://example.org/")
121 assert len(response.history) == 1122123

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 124–125why, one step back
124async def test_redirect_302(backend):
125 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 126why, one step back
126 response = await client.post("https://example.org/redirect_302")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 127why, one step back
127 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 128–131why, one step back
128 assert response.url == URL("https://example.org/")
129 assert len(response.history) == 1130131

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 132–133why, one step back
132async def test_redirect_303(backend):
133 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 134why, one step back
134 response = await client.get("https://example.org/redirect_303")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 135why, one step back
135 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 136–139why, one step back
136 assert response.url == URL("https://example.org/")
137 assert len(response.history) == 1138139

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 140–141why, one step back
140async def test_disallow_redirects(backend):
141 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

lines 142–143why, one step back
142 response = await client.post(
143 "https://example.org/redirect_303", allow_redirects=False

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 144why, one step back
144 )

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 145why, one step back
145 assert response.status_code == codes.SEE_OTHER

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 146why, one step back
146 assert response.url == URL("https://example.org/redirect_303")

Explicitly check is_redirect in simple test case (#208)Tammo Behrendsbefore adoptionbebedcb

line 147why, one step back
147 assert response.is_redirect is True

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 148–150why, one step back
148 assert len(response.history) == 0
149150 response = await response.next()

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 151why, one step back
151 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 152why, one step back
152 assert response.url == URL("https://example.org/")

Explicitly check is_redirect in simple test case (#208)Tammo Behrendsbefore adoptionbebedcb

line 153why, one step back
153 assert response.is_redirect is False

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 154–156why, one step back
154 assert len(response.history) == 1
155156

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 157–158why, one step back
157async def test_relative_redirect(backend):
158 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 159why, one step back
159 response = await client.get("https://example.org/relative_redirect")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 160why, one step back
160 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 161–164why, one step back
161 assert response.url == URL("https://example.org/")
162 assert len(response.history) == 1163164

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 165–166why, one step back
165async def test_no_scheme_redirect(backend):
166 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 167why, one step back
167 response = await client.get("https://example.org/no_scheme_redirect")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 168why, one step back
168 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 169–172why, one step back
169 assert response.url == URL("https://example.org/")
170 assert len(response.history) == 1171172

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 173–174why, one step back
173async def test_fragment_redirect(backend):
174 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 175why, one step back
175 response = await client.get("https://example.org/relative_redirect#fragment")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 176why, one step back
176 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 177–180why, one step back
177 assert response.url == URL("https://example.org/#fragment")
178 assert len(response.history) == 1179180

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 181–182why, one step back
181async def test_multiple_redirects(backend):
182 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 183why, one step back
183 response = await client.get("https://example.org/multiple_redirects?count=20")

Merge pull request #59 from encode/use-stdlib-status-codesTom Christiebefore adoptionafc8369

line 184why, one step back
184 assert response.status_code == codes.OK

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 185–186why, one step back
185 assert response.url == URL("https://example.org/multiple_redirects")
186 assert len(response.history) == 20

Multipart support (#90)Tom Christiebefore adoption6a44b05

lines 187–192why, one step back
187 assert response.history[0].url == URL(
188 "https://example.org/multiple_redirects?count=20"189 )190 assert response.history[1].url == URL(191 "https://example.org/multiple_redirects?count=19"192 )

Tweaks (#89)Tom Christiebefore adoption7c6fb5c

lines 193–194why, one step back
193 assert len(response.history[0].history) == 0
194 assert len(response.history[1].history) == 1

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 195–196why, one step back
195
196

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 197–198why, one step back
197async def test_too_many_redirects(backend):
198 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 199why, one step back
199 with pytest.raises(TooManyRedirects):

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 200why, one step back
200 await client.get("https://example.org/multiple_redirects?count=21")

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 201–202why, one step back
201
202

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 203–204why, one step back
203async def test_too_many_redirects_calling_next(backend):
204 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 205why, one step back
205 url = "https://example.org/multiple_redirects?count=21"

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 206why, one step back
206 response = await client.get(url, allow_redirects=False)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 207–211why, one step back
207 with pytest.raises(TooManyRedirects):
208 while response.is_redirect:209 response = await response.next()210211

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 212–213why, one step back
212async def test_redirect_loop(backend):
213 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 214why, one step back
214 with pytest.raises(RedirectLoop):

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 215why, one step back
215 await client.get("https://example.org/redirect_loop")

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 216–217why, one step back
216
217

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 218–219why, one step back
218async def test_redirect_loop_calling_next(backend):
219 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 220why, one step back
220 url = "https://example.org/redirect_loop"

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 221why, one step back
221 response = await client.get(url, allow_redirects=False)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 222–226why, one step back
222 with pytest.raises(RedirectLoop):
223 while response.is_redirect:224 response = await response.next()225226

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 227–228why, one step back
227async def test_cross_domain_redirect(backend):
228 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 229–230why, one step back
229 url = "https://example.com/cross_domain"
230 headers = {"Authorization": "abc"}

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 231why, one step back
231 response = await client.get(url, headers=headers)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 232why, one step back
232 assert response.url == URL("https://example.org/cross_domain_target")

Add response.json()Tom Christiebefore adoption2116d44

line 233why, one step back
233 assert "authorization" not in response.json()["headers"]

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 234–235why, one step back
234
235

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 236–237why, one step back
236async def test_same_domain_redirect(backend):
237 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 238–239why, one step back
238 url = "https://example.org/cross_domain"
239 headers = {"Authorization": "abc"}

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 240why, one step back
240 response = await client.get(url, headers=headers)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 241why, one step back
241 assert response.url == URL("https://example.org/cross_domain_target")

Add response.json()Tom Christiebefore adoption2116d44

line 242why, one step back
242 assert response.json()["headers"]["authorization"] == "abc"

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 243–244why, one step back
243
244

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 245–246why, one step back
245async def test_body_redirect(backend):
246 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 247–248why, one step back
247 url = "https://example.org/redirect_body"
248 data = b"Example request body"

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 249why, one step back
249 response = await client.post(url, data=data)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

line 250why, one step back
250 assert response.url == URL("https://example.org/redirect_body_target")

Add response.json()Tom Christiebefore adoption2116d44

line 251why, one step back
251 assert response.json() == {"body": "Example request body"}

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 252–253why, one step back
252
253

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 254–255why, one step back
254async def test_cannot_redirect_streaming_body(backend):
255 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Merge pull request #55 from encode/drop-adaptersTom Christiebefore adoptiond72a144

lines 256–261why, one step back
256 url = "https://example.org/redirect_body"
257258 async def streaming_body():259 yield b"Example request body"260261 with pytest.raises(RedirectBodyUnavailable):

Tidy up redirect testsTom Christiebefore adoptione40b0bf

line 262why, one step back
262 await client.post(url, data=streaming_body())

Remove "Host" header on redirects if URL origin has changed (#199)Yeray Diaz Diazbefore adoption95dad24

lines 263–264why, one step back
263
264

Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058

lines 265–266why, one step back
265async def test_cross_dubdomain_redirect(backend):
266 client = AsyncClient(dispatch=MockDispatch(), backend=backend)

Remove "Host" header on redirects if URL origin has changed (#199)Yeray Diaz Diazbefore adoption95dad24

lines 267–269why, one step back
267 url = "https://example.com/cross_subdomain"
268 response = await client.get(url)269 assert response.url == URL("https://www.example.org/cross_subdomain")