Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nextcloud_test): Skip CSRF token requests in fixtures #2293

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(nextcloud_test): Skip CSRF token requests in fixtures
Signed-off-by: provokateurin <kate@provokateurin.de>
provokateurin committed Jul 21, 2024

Verified

This commit was signed with the committer’s verified signature.
commit f3bdd0408108bf24bf5a71d38ddcf3ce1854b7f2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
GET http://localhost/index\.php
PROPFIND http://localhost/remote\.php/webdav
authorization: Bearer mock
content-type: application/xml
6 changes: 4 additions & 2 deletions packages/nextcloud_test/lib/src/proxy_http_client.dart
Original file line number Diff line number Diff line change
@@ -15,8 +15,10 @@ BaseClient getProxyHttpClient({
final realClient = Client();
return MockClient.streaming((baseRequest, bytesStream) async {
final bodyBytes = await bytesStream.toBytes();
final fixture = _formatHttpRequest(baseRequest, bodyBytes);
onRequest(fixture);
if (baseRequest.url.path != '/index.php') {
final fixture = _formatHttpRequest(baseRequest, bodyBytes);
onRequest(fixture);
}

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