[PR #1082] [MERGED] feat: reverts message in json output and allows configuration #977

Closed
opened 2026-02-25 23:36:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/1082
Author: @fmartingr
Created: 3/15/2025
Status: Merged
Merged: 3/16/2025
Merged by: @fmartingr

Base: masterHead: fix/middleware-message


📝 Commits (10+)

  • f9c6b68 feat: allow future deprecated message response with config
  • 67b3e41 tests: middleware
  • c561821 fix: middleware order
  • 62b634c fix: frontend using message in body
  • c2fab51 fix: cors
  • 96ec1ef feat: modify response type with header
  • 80349da fix(webapp): added new headers
  • ec956a2 dist: updated webapp files
  • f01c237 test(e2e): fixes
  • 0e10006 fix: middleware returning body for 204 requests

📊 Changes

26 files changed (+912 additions, -659 deletions)

View changed files

📝 e2e/playwright/auth_test.go (+58 -94)
📝 e2e/playwright/testhelper.go (+10 -0)
📝 internal/http/http.go (+3 -2)
📝 internal/http/middleware/cors.go (+2 -2)
internal/http/middleware/cors_test.go (+77 -0)
internal/http/middleware/message_response.go (+115 -0)
internal/http/middleware/message_response_test.go (+170 -0)
📝 internal/http/server.go (+6 -2)
📝 internal/http/webcontext/context.go (+5 -0)
📝 internal/model/http.go (+1 -0)
📝 internal/view/assets/js/component/login.js (+55 -77)
📝 internal/view/assets/js/page/base.js (+41 -30)
📝 internal/view/assets/js/page/home.js (+210 -293)
📝 internal/view/assets/js/page/setting.js (+78 -135)
internal/view/assets/js/utils/api.js (+67 -0)
📝 webapp/dist/assets/ArchiveView-DZOySksr.js (+1 -1)
📝 webapp/dist/assets/FoldersView-B-TWh6ac.js (+1 -1)
📝 webapp/dist/assets/SettingsView-BWJgD3kk.js (+1 -1)
webapp/dist/assets/TagsView-C_xWTaWR.js (+0 -1)
webapp/dist/assets/TagsView-CmDnarVi.js (+1 -0)

...and 6 more files

📄 Description

  • Reverts back the responses of the API to be like {"ok": bool, "message": body}
  • Allows using the future response by setting the X-Shiori-Request-Format to new

This will be the default until 2.0 is released with the removal of the legacy API.


🔄 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/go-shiori/shiori/pull/1082 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 3/15/2025 **Status:** ✅ Merged **Merged:** 3/16/2025 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `fix/middleware-message` --- ### 📝 Commits (10+) - [`f9c6b68`](https://github.com/go-shiori/shiori/commit/f9c6b68145ae3ed9b912cf0c4f90cdd2c94c2634) feat: allow future deprecated message response with config - [`67b3e41`](https://github.com/go-shiori/shiori/commit/67b3e41defd880b2f609981b4357195a17e03a44) tests: middleware - [`c561821`](https://github.com/go-shiori/shiori/commit/c561821e0881b164fde17a86499002ea1c11bc06) fix: middleware order - [`62b634c`](https://github.com/go-shiori/shiori/commit/62b634c0da05dc039242e334dd64bae38d8176e5) fix: frontend using message in body - [`c2fab51`](https://github.com/go-shiori/shiori/commit/c2fab518bbe421eceba85be30aac1704be69df82) fix: cors - [`96ec1ef`](https://github.com/go-shiori/shiori/commit/96ec1ef65e964d879a088644e51db6be2a903e91) feat: modify response type with header - [`80349da`](https://github.com/go-shiori/shiori/commit/80349dad2d6d4d446880b9f8f6ecd283eeb87f7f) fix(webapp): added new headers - [`ec956a2`](https://github.com/go-shiori/shiori/commit/ec956a274a249b267c4a948de8f75987737a5588) dist: updated webapp files - [`f01c237`](https://github.com/go-shiori/shiori/commit/f01c237f374c92d979894f98838b439c18cbe25e) test(e2e): fixes - [`0e10006`](https://github.com/go-shiori/shiori/commit/0e10006eb5692186f84ddf83b6fe6649af35f6ee) fix: middleware returning body for 204 requests ### 📊 Changes **26 files changed** (+912 additions, -659 deletions) <details> <summary>View changed files</summary> 📝 `e2e/playwright/auth_test.go` (+58 -94) 📝 `e2e/playwright/testhelper.go` (+10 -0) 📝 `internal/http/http.go` (+3 -2) 📝 `internal/http/middleware/cors.go` (+2 -2) ➕ `internal/http/middleware/cors_test.go` (+77 -0) ➕ `internal/http/middleware/message_response.go` (+115 -0) ➕ `internal/http/middleware/message_response_test.go` (+170 -0) 📝 `internal/http/server.go` (+6 -2) 📝 `internal/http/webcontext/context.go` (+5 -0) 📝 `internal/model/http.go` (+1 -0) 📝 `internal/view/assets/js/component/login.js` (+55 -77) 📝 `internal/view/assets/js/page/base.js` (+41 -30) 📝 `internal/view/assets/js/page/home.js` (+210 -293) 📝 `internal/view/assets/js/page/setting.js` (+78 -135) ➕ `internal/view/assets/js/utils/api.js` (+67 -0) 📝 `webapp/dist/assets/ArchiveView-DZOySksr.js` (+1 -1) 📝 `webapp/dist/assets/FoldersView-B-TWh6ac.js` (+1 -1) 📝 `webapp/dist/assets/SettingsView-BWJgD3kk.js` (+1 -1) ➖ `webapp/dist/assets/TagsView-C_xWTaWR.js` (+0 -1) ➕ `webapp/dist/assets/TagsView-CmDnarVi.js` (+1 -0) _...and 6 more files_ </details> ### 📄 Description - Reverts back the responses of the API to be like `{"ok": bool, "message": body}` - Allows using the future response by setting the `X-Shiori-Request-Format` to `new` This will be the default until 2.0 is released with the removal of the legacy API. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:36:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#977
No description provided.