[arch-commits] Commit in hey/trunk (2 files)
Jelle van der Waa
jelle at archlinux.org
Thu Nov 19 15:53:27 UTC 2020
Date: Thursday, November 19, 2020 @ 15:53:26
Author: jelle
Revision: 757601
Fix RELRO and Servername related bug
Added:
hey/trunk/0001-Handle-Request.Host-containing-the-server-port.patch
Modified:
hey/trunk/PKGBUILD
-----------------------------------------------------------+
0001-Handle-Request.Host-containing-the-server-port.patch | 44 ++++++++++++
PKGBUILD | 10 +-
2 files changed, 50 insertions(+), 4 deletions(-)
Added: 0001-Handle-Request.Host-containing-the-server-port.patch
===================================================================
--- 0001-Handle-Request.Host-containing-the-server-port.patch (rev 0)
+++ 0001-Handle-Request.Host-containing-the-server-port.patch 2020-11-19 15:53:26 UTC (rev 757601)
@@ -0,0 +1,44 @@
+From 292dd07ebd79a5236921231d82c85bcb3874f188 Mon Sep 17 00:00:00 2001
+From: Jelle van der Waa <jelle at vdwaa.nl>
+Date: Thu, 19 Nov 2020 14:51:31 +0100
+Subject: [PATCH] Handle Request.Host containing the server port
+
+As written in the net/http/#Request documentation Host may be of the
+form "host:port" and as defined in rfc4366 section-3.1 the serverName
+should not contain the port or colon.
+---
+ requester/requester.go | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/requester/requester.go b/requester/requester.go
+index fd7277e..924d945 100644
+--- a/requester/requester.go
++++ b/requester/requester.go
+@@ -20,6 +20,7 @@ import (
+ "crypto/tls"
+ "io"
+ "io/ioutil"
++ "net"
+ "net/http"
+ "net/http/httptrace"
+ "net/url"
+@@ -235,10 +236,15 @@ func (b *Work) runWorkers() {
+ var wg sync.WaitGroup
+ wg.Add(b.C)
+
++ hostName, _, err := net.SplitHostPort(b.Request.Host);
++ if err != nil {
++ hostName = b.Request.Host;
++ }
++
+ tr := &http.Transport{
+ TLSClientConfig: &tls.Config{
+ InsecureSkipVerify: true,
+- ServerName: b.Request.Host,
++ ServerName: hostName,
+ },
+ MaxIdleConnsPerHost: min(b.C, maxIdleConn),
+ DisableCompression: b.DisableCompression,
+--
+2.29.2
+
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-11-19 15:50:24 UTC (rev 757600)
+++ PKGBUILD 2020-11-19 15:53:26 UTC (rev 757601)
@@ -2,7 +2,7 @@
pkgname=hey
pkgver=0.1.4
-pkgrel=1
+pkgrel=2
pkgdesc='HTTP load generator'
url="https://github.com/rakyll/hey"
arch=(x86_64)
@@ -9,8 +9,10 @@
license=('GPL')
depends=('glibc')
makedepends=('go')
-source=($pkgname-$pkgver.tar.gz::https://github.com/rakyll/hey/archive/v$pkgver.tar.gz)
-sha512sums=('f71ad13c401e9c9c45e1176924de49eb33df9b180dc10907997d1e500a4e5c6e28dd0293cef5d3fe8fabf0bfbade353938327bf3fce894c271209ec86e265ead')
+source=($pkgname-$pkgver.tar.gz::https://github.com/rakyll/hey/archive/v$pkgver.tar.gz
+ 0001-Handle-Request.Host-containing-the-server-port.patch)
+sha512sums=('f71ad13c401e9c9c45e1176924de49eb33df9b180dc10907997d1e500a4e5c6e28dd0293cef5d3fe8fabf0bfbade353938327bf3fce894c271209ec86e265ead'
+ '97c2e54d4f9b67c8beda5b3c034e501cdec9d6636bfaaf7d33a27927c96915b73906400dc2a17888144a4748a0f37462ccd2c90b35ca4f3221f3a410cf81af16')
build() {
@@ -20,7 +22,7 @@
-buildmode=pie \
-mod=readonly \
-modcacherw \
- -ldflags "-extldflags \"${LDFLAGS}\"" \
+ -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
.
}
More information about the arch-commits
mailing list