Skip to content

Commit

Permalink
allow query param in app id middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Jan 9, 2024
1 parent 94073de commit 7ac008e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/middleware/app-id.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Injectable, NestMiddleware } from '@nestjs/common'
@Injectable()
export class AppIdMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: NextFunction) {
const appId = req.headers['app-id']
const appId = req.headers['app-id'] || req.query['app-id']

if (!appId) {
res.status(400).json({ message: 'App ID (app-id) header is required' })
res.status(400).json({ message: 'App ID (app-id) header or query is required' })
return
}

Expand Down

0 comments on commit 7ac008e

Please sign in to comment.