Skip to content

Commit

Permalink
fix: allow slashes in media/document ids (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabaslegeny authored Dec 6, 2023
1 parent f695837 commit a3da577
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function (logger: Logger, db: MediaDatabase, config: Record<strin
)

app.get(
'/media/info/:id',
'/media/info/:id(*)',
wrap(async (req, res) => {
const { mediainfo } = await db.get(req.params.id.toUpperCase())
res.set('content-type', 'application/json')
Expand All @@ -47,7 +47,7 @@ export default function (logger: Logger, db: MediaDatabase, config: Record<strin
)

app.get(
'/media/thumbnail/:id',
'/media/thumbnail/:id(*)',
wrap(async (req, res) => {
const { _attachments } = await db.get(req.params.id.toUpperCase(), { attachments: true, binary: true })

Expand Down Expand Up @@ -185,7 +185,7 @@ export default function (logger: Logger, db: MediaDatabase, config: Record<strin
)

app.get(
'/cinf/:id',
'/cinf/:id(*)',
wrap(async (req, res) => {
const { cinf } = await db.get(req.params.id.toUpperCase())
res.set('content-type', 'text/plain')
Expand All @@ -203,7 +203,7 @@ export default function (logger: Logger, db: MediaDatabase, config: Record<strin
)

app.get(
'/thumbnail/generate/:id',
'/thumbnail/generate/:id(*)',
wrap(async (_req, res) => {
// TODO (fix) Force scanner to scan and wait?
res.set('content-type', 'text/plain')
Expand All @@ -224,7 +224,7 @@ export default function (logger: Logger, db: MediaDatabase, config: Record<strin
)

app.get(
'/thumbnail/:id',
'/thumbnail/:id(*)',
wrap(async (req, res) => {
const { _attachments } = await db.get(req.params.id.toUpperCase(), { attachments: true })

Expand Down

0 comments on commit a3da577

Please sign in to comment.