[PR #1206] [MERGED] Respond with bad request to unvalid request data #3482

Closed
opened 2026-04-25 00:15:49 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/1206
Author: @lkiesow
Created: 11/23/2022
Status: Merged
Merged: 11/23/2022
Merged by: @advplyr

Base: masterHead: 400-bad-request


📝 Commits (1)

  • a8162b5 Respond with bad request to unvalid request data

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 server/controllers/MeController.js (+1 -1)

📄 Description

This patch updates the batch progress update endpoint to respond with a 400 Bad Request instead of a 500 Internal Server Error if a user sends an invalid request with no body. This is a user error after all.

❯ curl -i -X PATCH \
  'http://127.0.0.1:3333/api/me/progress/batch/update' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5Q_MoRptP0oI' \
  -H 'Content-Type: application/json'
HTTP/1.1 400 Bad Request
…

Missing request payload

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/1206 **Author:** [@lkiesow](https://github.com/lkiesow) **Created:** 11/23/2022 **Status:** ✅ Merged **Merged:** 11/23/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `400-bad-request` --- ### 📝 Commits (1) - [`a8162b5`](https://github.com/advplyr/audiobookshelf/commit/a8162b57ba501f307080d597df9c6f9b7b63fd43) Respond with bad request to unvalid request data ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/MeController.js` (+1 -1) </details> ### 📄 Description This patch updates the batch progress update endpoint to respond with a `400 Bad Request` instead of a `500 Internal Server Error` if a user sends an invalid request with no body. This is a user error after all. ``` ❯ curl -i -X PATCH \ 'http://127.0.0.1:3333/api/me/progress/batch/update' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5Q_MoRptP0oI' \ -H 'Content-Type: application/json' HTTP/1.1 400 Bad Request … Missing request payload ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:15:49 +02:00
adam closed this issue 2026-04-25 00:15:49 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3482