From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 38E3A1F59D for ; Thu, 4 Aug 2022 08:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1659601024; bh=ymoqyhC2OrVy2XoGxgFJ5TBRnnf3+59QRo0X83m2q4Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Sk5LFQ1wGA/z7xJj2rhEhvJ5B3HT3ay6DkAaBFOP70twlt+xLC3YxOLjY3KXNX76m vBCIim1zF0g6FO2Rku7CLKrp4gxnhcEdmwDa8ERzGN+azbueMR8/3hY1wOM577ZHG6 BBHYYC1xghUG3EJEmHusjVIYduBJFzBs8P1fMGVE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/7] http: coerce SERVER_PORT to integer Date: Thu, 4 Aug 2022 08:16:57 +0000 Message-Id: <20220804081703.1410595-2-e@80x24.org> In-Reply-To: <20220804081703.1410595-1-e@80x24.org> References: <20220804081703.1410595-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This may save a few bytes with many connected clients. Noticed while working on the JMAP endpoint. --- lib/PublicInbox/HTTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 669211e3..3d4e3499 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -135,7 +135,7 @@ sub app_dispatch { $env->{REMOTE_ADDR} = $self->{remote_addr}; $env->{REMOTE_PORT} = $self->{remote_port}; if (defined(my $host = $env->{HTTP_HOST})) { - $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1; + $host =~ s/:([0-9]+)\z// and $env->{SERVER_PORT} = $1 + 0; $env->{SERVER_NAME} = $host; } if (defined $input) {