Skip to content

Commit f3bdd04

Browse files
committed
fix(nextcloud_test): Skip CSRF token requests in fixtures
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent e7d6ad1 commit f3bdd04

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/nextcloud/test/fixtures/webdav/list_directory.regexp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
GET http://localhost/index\.php
21
PROPFIND http://localhost/remote\.php/webdav
32
authorization: Bearer mock
43
content-type: application/xml

packages/nextcloud_test/lib/src/proxy_http_client.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ BaseClient getProxyHttpClient({
1515
final realClient = Client();
1616
return MockClient.streaming((baseRequest, bytesStream) async {
1717
final bodyBytes = await bytesStream.toBytes();
18-
final fixture = _formatHttpRequest(baseRequest, bodyBytes);
19-
onRequest(fixture);
18+
if (baseRequest.url.path != '/index.php') {
19+
final fixture = _formatHttpRequest(baseRequest, bodyBytes);
20+
onRequest(fixture);
21+
}
2022

2123
final request = Request(baseRequest.method, baseRequest.url)
2224
..persistentConnection = baseRequest.persistentConnection

0 commit comments

Comments
 (0)