fix(api): support accept header in getBookPage (#352)

* fix(api): support accept header in getBookPage

API is documented as supporting `accept: image/*` in the HTTP request,
but doing so results in server response with the status 406.

This commit updates the `GetMapping` annotation to correctly support
these values in the HTTP `accept` header.

closes #350

* fix: failing test

Co-authored-by: Gauthier Roebroeck <gauthier.roebroeck@gmail.com>
This commit is contained in:
Sylvain Laperche 2020-11-02 20:16:14 +00:00 committed by GitHub
parent ae5917eb1a
commit e123d38692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -298,7 +298,7 @@ class BookController(
@GetMapping(value = [
"api/v1/books/{bookId}/pages/{pageNumber}",
"opds/v1.2/books/{bookId}/pages/{pageNumber}"
])
], produces = [MediaType.ALL_VALUE])
@PreAuthorize("hasRole('$ROLE_PAGE_STREAMING')")
fun getBookPage(
@AuthenticationPrincipal principal: KomgaPrincipal,