Skip to content

Commit

Permalink
fix(nano-server): compatible with ParamValueType
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Jan 30, 2023
1 parent 0d229f5 commit 325d896
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/nano-server/src/nano-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ export class AlwatrConnection {
/**
* Parse query param and validate with param type.
*/
protected _sanitizeParam(name: string, type: ParamKeyType): ParamValueType {
protected _sanitizeParam(name: string, type: ParamKeyType): ParamValueType | null {
let value = this.url.searchParams.get(name);

if (value == null || value.length === 0) {
if (value == null || value === '') {
return null;
}

Expand Down

0 comments on commit 325d896

Please sign in to comment.