Skip to content

Commit 80fbbc2

Browse files
authored
fix: Set a default for badge from request params (#596)
1 parent 15caf3a commit 80fbbc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/services/fetchBadges.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function getBadgeUrl(
8888
req: Request, item: { slug: string, type: string, data: string } | null,
8989
): string {
9090
// build url using request params and query
91-
const params = Object.values(req.params).map((p) => encodeURIComponent(p)).join('/');
91+
const params = Object.values(req.params).map((p) => encodeURIComponent(p)).join('/') || 'badge/-test-blue';
9292
const host = typeof req.query.host === 'string' ? req.query.host : 'img.shields.io';
9393
if (!isValidHost(host)) {
9494
throw new BadgeError('invalid host');

0 commit comments

Comments
 (0)