move more args of Upstream() to upstream Options

This commit is contained in:
6543 2021-12-05 19:53:23 +01:00
parent 2f6b280fce
commit a7bb3448a4
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
4 changed files with 56 additions and 30 deletions

View file

@ -0,0 +1,13 @@
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTrimHostPort(t *testing.T) {
assert.EqualValues(t, "aa", TrimHostPort([]byte("aa")))
assert.EqualValues(t, "", TrimHostPort([]byte(":")))
assert.EqualValues(t, "example.com", TrimHostPort([]byte("example.com:80")))
}