Skip to content

Commit c76fde7

Browse files
committed
fix(#78): use URL API for robust query param handling
1 parent abc8628 commit c76fde7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codebenders-dashboard/app/api/students/[guid]/sis-link/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export async function GET(
5252

5353
// SIS ID is embedded in the URL but never returned as a standalone field
5454
const sisId = result.rows[0].sis_id
55-
url = `${sisBaseUrl}?${encodeURIComponent(SIS_ID_PARAM)}=${encodeURIComponent(sisId)}`
55+
const urlObj = new URL(sisBaseUrl)
56+
urlObj.searchParams.set(SIS_ID_PARAM, sisId)
57+
url = urlObj.toString()
5658
} catch (error) {
5759
console.error("SIS link lookup error:", error)
5860
return NextResponse.json(

0 commit comments

Comments
 (0)