Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Merge pull request #89 from missedone/issue/82

JBDad1206917c4a
diff --cc boom.go
index c674f0e,4eea4fb..b7465a8
--- a/boom.go
+++ b/boom.go
@@@ -28,11 -29,23 +28,23 @@@ import
)
const (
- headerRegexp = "^([\\w-]+):\\s*(.+)"
- authRegexp = "^([\\w-\\.]+):(.+)"
+ headerRegexp = `^([\w-]+):\s*(.+)`
+ authRegexp = `^(.+):([^\s].+)`
)
+ type headerSlice []string
+
+ func (h *headerSlice) String() string {
+ return fmt.Sprintf("%s", *h)
+ }
+
+ func (h *headerSlice) Set(value string) error {
+ *h = append(*h, value)
+ return nil
+ }
+
var (
+ headerslice headerSlice
m = flag.String("m", "GET", "")
headers = flag.String("h", "", "")
body = flag.String("d", "", "")