mirror of https://github.com/mpolden/echoip
Merge 8c95d5c28b
into 803697b91a
This commit is contained in:
commit
a1bede8fc0
|
@ -25,7 +25,7 @@ const (
|
|||
)
|
||||
|
||||
var userAgentPattern = regexp.MustCompile(
|
||||
`^(?:curl|Wget|fetch\slibfetch|ddclient|Go-http-client|HTTPie)\/.*|Go\s1\.1\spackage\shttp$`,
|
||||
`^(?:curl|Wget|fetch\slibfetch|ddclient|Go-http-client|HTTPie|[pP]ython-\w+)\/.*|Go\s1\.1\spackage\shttp$`,
|
||||
)
|
||||
|
||||
type API struct {
|
||||
|
|
|
@ -156,6 +156,9 @@ func TestCLIMatcher(t *testing.T) {
|
|||
{"Go-http-client/1.1", true},
|
||||
{"Go-http-client/2.0", true},
|
||||
{"ddclient/3.8.3", true},
|
||||
{"Python-urllib/2.7", true},
|
||||
{"python-urllib/3.5", true},
|
||||
{"python-requests/2.11", true},
|
||||
{browserUserAgent, false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
|
Loading…
Reference in New Issue