From 9e0022ba795b5b558a816817a8457908e940d7b4 Mon Sep 17 00:00:00 2001 From: dbernstein Date: Wed, 13 Nov 2024 10:42:40 -0800 Subject: [PATCH] [PP-1905] Ensure OPDS 1 Feed defaults to Version 1. (#2164) --- src/palace/manager/feed/opds.py | 2 +- tests/manager/feed/test_opds_base.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/palace/manager/feed/opds.py b/src/palace/manager/feed/opds.py index c69d323bb..e09435354 100644 --- a/src/palace/manager/feed/opds.py +++ b/src/palace/manager/feed/opds.py @@ -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: diff --git a/tests/manager/feed/test_opds_base.py b/tests/manager/feed/test_opds_base.py index 61fa78347..0c44e03e9 100644 --- a/tests/manager/feed/test_opds_base.py +++ b/tests/manager/feed/test_opds_base.py @@ -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],