Skip to content

Commit

Permalink
fix: request.connection deprecation
Browse files Browse the repository at this point in the history
This commit reorders the client IP gathering process, prioritising `request.socket` to be accessed before `request.connection`, which is now a deprecated object.
  • Loading branch information
BirkhoffLee authored Mar 6, 2022
1 parent 1fcffa5 commit 592264b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class Request extends InteractsWithHeaders {
*/
getClientIp (): string | undefined {
return this.fromHeaders() ??
this.fromConnection() ??
this.fromSocket() ??
this.fromConnection() ??
this.fromInfo() ??
this.fromRaw() ??
this.fromRequestContext()
Expand Down

0 comments on commit 592264b

Please sign in to comment.