mirror of
https://github.com/mpolden/echoip.git
synced 2025-06-25 12:17:52 +02:00
Add support for HTTPie. Fixes #13
This commit is contained in:
@ -18,7 +18,7 @@ import (
|
||||
|
||||
const APPLICATION_JSON = "application/json"
|
||||
|
||||
var cliUserAgentExp = regexp.MustCompile(`^(?i)((curl|wget|fetch\slibfetch|Go-http-client)\/.*|Go\s1\.1\spackage\shttp)$`)
|
||||
var cliUserAgentExp = regexp.MustCompile(`^((curl|Wget|fetch\slibfetch|Go-http-client|HTTPie)\/.*|Go\s1\.1\spackage\shttp)$`)
|
||||
|
||||
type API struct {
|
||||
CORS bool
|
||||
|
@ -132,6 +132,7 @@ func TestCLIMatcher(t *testing.T) {
|
||||
{"curl/7.26.0", true},
|
||||
{"Wget/1.13.4 (linux-gnu)", true},
|
||||
{"fetch libfetch/2.0", true},
|
||||
{"HTTPie/0.9.3", true},
|
||||
{browserUserAgent, false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
Reference in New Issue
Block a user