Allow falsey get parameter values (#257)

This commit is contained in:
matc-pub 2024-04-15 15:04:19 +02:00 committed by GitHub
parent b577deee2f
commit 0923a67c93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1547,7 +1547,7 @@ export class LemmyHttp {
function encodeGetParams<BodyType extends object>(p: BodyType): string { function encodeGetParams<BodyType extends object>(p: BodyType): string {
return Object.entries(p) return Object.entries(p)
.filter(kv => !!kv[1]) .filter(kv => kv[1] !== undefined && kv[1] !== null)
.map(kv => kv.map(encodeURIComponent).join("=")) .map(kv => kv.map(encodeURIComponent).join("="))
.join("&"); .join("&");
} }