Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- Fix JSON parsing of empty OCS results: the API serializes empty collections
as `[]` instead of `{}`, which caused a `MismatchedInputException` when e.g.
listing users or groups on an empty result (issue #112)
- Fix file uploads (and other WebDAV writes) failing on servers running on a
non-standard port: preemptive authentication now uses the configured port, so
the server no longer issues an auth challenge that a streamed upload cannot
retry (issue #112)
- Testing: integration tests can now auto-provision a throw-away Nextcloud
server via Testcontainers when Docker is available, and are executed in CI
(GitHub Actions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ protected Sardine buildAuthSardine()
Sardine sardine = SardineFactory.begin();
sardine.setCredentials(this.serverConfig.getUserName(),
this.serverConfig.getAuthenticationConfig().getPassword());
sardine.enablePreemptiveAuthentication(this.serverConfig.getServerName());
// Pass the configured port so preemptive authentication also applies
// on non-standard ports (e.g. behind a reverse proxy). Without it the
// hostname-only overload assumes ports 80/443, the server then issues
// an auth challenge, and non-repeatable requests such as a streamed
// file upload (PUT) fail because they cannot be retried.
sardine.enablePreemptiveAuthentication(this.serverConfig.getServerName(),
this.serverConfig.getPort(), this.serverConfig.getPort());
return sardine;
}
return new SardineImpl(this.serverConfig.getAuthenticationConfig().getBearerToken());
Expand Down
Loading