Skip to content

Commit

Permalink
[PP-1905] Ensure OPDS 1 Feed defaults to Version 1. (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernstein committed Nov 13, 2024
1 parent 0678bf3 commit 9e0022b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/palace/manager/feed/opds.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def get_serializer(
) -> SerializerInterface[Any]:
# Ordering matters for poor matches (eg. */*), so we will keep OPDS1 first
serializers: dict[str, type[SerializerInterface[Any]]] = {
"application/atom+xml; api-version=2": OPDS1Version2Serializer,
"application/atom+xml": OPDS1Version1Serializer,
"application/atom+xml; api-version=2": OPDS1Version2Serializer,
"application/opds+json": OPDS2Serializer,
}
if mime_types:
Expand Down
1 change: 1 addition & 0 deletions tests/manager/feed/test_opds_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TestBaseOPDSFeed:
"accept_header, serializer",
[
# test api-version parameter when specified return the appropriate version
["*/*", OPDS1Version1Serializer],
["application/atom+xml;", OPDS1Version1Serializer],
["application/atom+xml;api-version=1", OPDS1Version1Serializer],
["application/atom+xml;api-version=2", OPDS1Version2Serializer],
Expand Down

0 comments on commit 9e0022b

Please sign in to comment.