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

Return empty array if there are no objects to list #239

Merged
merged 3 commits into from
Jun 17, 2023

Conversation

MichaelEischer
Copy link
Member

@MichaelEischer MichaelEischer commented Jun 16, 2023

What is the purpose of this change? What does it change?

Previously "null" was returned, which does not match the REST backend specification.

Was the change discussed in an issue or in the forum before?

Fixes #238

Checklist

  • I have enabled maintainer edits for this PR
  • I have added tests for all changes in this PR
  • [ ] I have added documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

Previously "null" was returned, which does not match the REST backend
specification.
The test should test both API versions.
@MichaelEischer
Copy link
Member Author

LGTM.

@MichaelEischer MichaelEischer merged commit 3130a4b into restic:master Jun 17, 2023
5 checks passed
@MichaelEischer MichaelEischer deleted the empty-list branch June 17, 2023 20:08
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 19, 2023
Fix PKGNAME while here.

Changelog for rest-server 0.12.1 (2023-07-09)
============================================

The following sections list the changes in rest-server 0.12.1 relevant
to users. The changes are ordered by importance.

Summary
-------

 * Fix #230: Fix erroneous warnings about unsupported fsync
 * Fix #238: API: Return empty array when listing empty folders
 * Enh #217: Log to stdout using the `--log -` option

Details
-------

 * Bugfix #230: Fix erroneous warnings about unsupported fsync

   Due to a regression in rest-server 0.12.0, it continuously printed `WARNING: fsync is not
   supported by the data storage. This can lead to data loss, if the system crashes or the storage is
   unexpectedly disconnected.` for systems that support fsync. We have fixed the warning.

   restic/rest-server#230
   restic/rest-server#231

 * Bugfix #238: API: Return empty array when listing empty folders

   Rest-server returned `null` when listing an empty folder. This has been changed to returning
   an empty array in accordance with the REST protocol specification. This change has no impact on
   restic users.

   restic/rest-server#238
   restic/rest-server#239

 * Enhancement #217: Log to stdout using the `--log -` option

   Logging to stdout was possible using `--log /dev/stdout`. However, when the rest server is run
   as a different user, for example, using

   `sudo -u restic rest-server [...] --log /dev/stdout`

   This did not work due to permission issues.

   For logging to stdout, the `--log` option now supports the special filename `-` which also
   works in these cases.

   restic/rest-server#217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rest-server doesn't correctly implement REST API
1 participant