Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Handle header values with spaces, allow header keys to contain dashes.

Burcu Dogan0794be435169
diff --git a/main.go b/main.go
index fb896ed..ef8b226 100644
--- a/main.go
+++ b/main.go
@@ -93,7 +93,7 @@ func main() {
if *flagHeaders != "" {
headers := strings.Split(*flagHeaders, ";")
for _, h := range headers {
- re := regexp.MustCompile("(\\w+):(\\w+)")
+ re := regexp.MustCompile("([\\w|-]+):(.+)")
matches := re.FindAllStringSubmatch(h, -1)
if len(matches) < 1 {
usageAndExit()