u
This commit is contained in:
@@ -103,7 +103,9 @@ export function register(app, basePath = '') {
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/Error'
|
||||
*/
|
||||
app.get(`${basePath}/image/:fullHash`, async (req, res) => {
|
||||
const imagePaths = [`${basePath}/image/:fullHash`];
|
||||
if (basePath) imagePaths.push('/image/:fullHash');
|
||||
app.get(imagePaths, async (req, res) => {
|
||||
const parsed = parseFullHash(req.params.fullHash);
|
||||
if (parsed.error) {
|
||||
return res.status(400).json({ error: parsed.error });
|
||||
@@ -186,7 +188,9 @@ export function register(app, basePath = '') {
|
||||
* schema:
|
||||
* $ref: '#/components/schemas/Error'
|
||||
*/
|
||||
app.get(`${basePath}/thumb/:fullHash`, async (req, res) => {
|
||||
const thumbPaths = [`${basePath}/thumb/:fullHash`];
|
||||
if (basePath) thumbPaths.push('/thumb/:fullHash');
|
||||
app.get(thumbPaths, async (req, res) => {
|
||||
const parsed = parseFullHash(req.params.fullHash);
|
||||
if (parsed.error) {
|
||||
return res.status(400).json({ error: parsed.error });
|
||||
|
||||
Reference in New Issue
Block a user