mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-04 01:17:19 +02:00
Merge d7262d4725
into c2ecfd428b
This commit is contained in:
commit
81a76156a0
30
docs/controllers/ServerController.yaml
Normal file
30
docs/controllers/ServerController.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
paths:
|
||||||
|
/ping:
|
||||||
|
get:
|
||||||
|
operationId: ping
|
||||||
|
summary: Ping the server
|
||||||
|
description: This endpoint is a simple check to see if the server is operating and responding with JSON correctly.
|
||||||
|
tags:
|
||||||
|
- Server
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: ping OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
success:
|
||||||
|
type: boolean
|
||||||
|
example: true
|
||||||
|
/healthcheck:
|
||||||
|
get:
|
||||||
|
operationId: healthcheck
|
||||||
|
summary: Health check
|
||||||
|
description: This endpoint is a simple check to see if the server is operating and can respond.
|
||||||
|
tags:
|
||||||
|
- Server
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: healthcheck OK
|
||||||
|
content: {}
|
@ -15,6 +15,8 @@ components:
|
|||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
paths:
|
paths:
|
||||||
|
/ping:
|
||||||
|
$ref: './controllers/ServerCONTROLLER.yaml#/paths/~1ping'
|
||||||
/api/authors/{id}:
|
/api/authors/{id}:
|
||||||
$ref: './controllers/AuthorController.yaml#/paths/~1api~1authors~1{id}'
|
$ref: './controllers/AuthorController.yaml#/paths/~1api~1authors~1{id}'
|
||||||
/api/authors/{id}/image:
|
/api/authors/{id}/image:
|
||||||
@ -90,3 +92,5 @@ tags:
|
|||||||
description: Notifications endpoints
|
description: Notifications endpoints
|
||||||
- name: Podcasts
|
- name: Podcasts
|
||||||
description: Podcast endpoints
|
description: Podcast endpoints
|
||||||
|
- name: Server
|
||||||
|
description: Server endpoints
|
||||||
|
@ -1467,12 +1467,12 @@ class LibraryController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
async middleware(req, res, next) {
|
async middleware(req, res, next) {
|
||||||
if (!req.user.checkCanAccessLibrary(req.params.id)) {
|
if (!req.user.checkCanAccessLibrary(req.params.id.toLowerCase())) {
|
||||||
Logger.warn(`[LibraryController] Library ${req.params.id} not accessible to user ${req.user.username}`)
|
Logger.warn(`[LibraryController] Library ${req.params.id} not accessible to user ${req.user.username}`)
|
||||||
return res.sendStatus(403)
|
return res.sendStatus(403)
|
||||||
}
|
}
|
||||||
|
|
||||||
const library = await Database.libraryModel.findByIdWithFolders(req.params.id)
|
const library = await Database.libraryModel.findByIdWithFolders(req.params.id.toLowerCase())
|
||||||
if (!library) {
|
if (!library) {
|
||||||
return res.status(404).send('Library not found')
|
return res.status(404).send('Library not found')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user