mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-05 07:16:24 +00:00
Merge pull request #3085 from marcschaeferger-org/security-updates
Normalize request parameters and update dependencies for Security
This commit is contained in:
11
server/lib/requestParams.ts
Normal file
11
server/lib/requestParams.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function getFirstString(value: unknown): string | undefined {
|
||||
if (typeof value === "string") {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (Array.isArray(value) && typeof value[0] === "string") {
|
||||
return value[0];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user