[Bug]: Uploading a cover with PATCH method instead of POST crashes the server #1047

Closed
opened 2026-04-24 23:30:05 +02:00 by adam · 1 comment
Owner

Originally created by @tkozybski on GitHub (Apr 2, 2023).

Describe the issue

I accidentally used PATCH instead of POST for Uploading the cover, and it crashes the server. It's repetitive. The exact Python code I used:

def upload_library_item_cover(self, library_item_id, cover_url : str):
        url = self.domain + f"/api/items/{library_item_id}/cover"
        
        to_change = dict()
        to_change["url"] = cover_url

        json_data = json.dumps(to_change)

        headers = {
            'Content-type': 'application/json',
            'Authorization': "Bearer " + self.token
        }
        
        response = requests.patch(url, data=json_data, headers=headers) #Use post instead!

Steps to reproduce the issue

  1. Call this with PATCH instead of POST.

Audiobookshelf version

v2.2.17

How are you running audiobookshelf?

Docker

Originally created by @tkozybski on GitHub (Apr 2, 2023). ### Describe the issue I accidentally used PATCH instead of POST for [Uploading the cover](https://api.audiobookshelf.org/#upload-a-library-item-cover), and it crashes the server. It's repetitive. The exact Python code I used: ``` def upload_library_item_cover(self, library_item_id, cover_url : str): url = self.domain + f"/api/items/{library_item_id}/cover" to_change = dict() to_change["url"] = cover_url json_data = json.dumps(to_change) headers = { 'Content-type': 'application/json', 'Authorization': "Bearer " + self.token } response = requests.patch(url, data=json_data, headers=headers) #Use post instead! ``` ### Steps to reproduce the issue 1. Call [this](https://api.audiobookshelf.org/#upload-a-library-item-cover) with PATCH instead of POST. ### Audiobookshelf version v2.2.17 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:30:06 +02:00
adam closed this issue 2026-04-24 23:30:06 +02:00
Author
Owner

@advplyr commented on GitHub (Apr 17, 2023):

Fixed in v2.2.19

@advplyr commented on GitHub (Apr 17, 2023): Fixed in [v2.2.19](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.19)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1047