79765fb7cc
Includes: - fix for unavailable endpoints of client pool, - session token cache with request retry in case of missing session token, - migrated neofs client. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
32 lines
779 B
Go
32 lines
779 B
Go
package uploader
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/logger"
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
func TestFilter(t *testing.T) {
|
|
log, err := logger.New()
|
|
require.NoError(t, err)
|
|
|
|
req := &fasthttp.RequestHeader{}
|
|
req.DisableNormalizing()
|
|
req.Set("X-Attribute-Neofs-Expiration-Epoch1", "101")
|
|
req.Set("X-Attribute-NEOFS-Expiration-Epoch2", "102")
|
|
req.Set("X-Attribute-neofs-Expiration-Epoch3", "103")
|
|
req.Set("X-Attribute-MyAttribute", "value")
|
|
|
|
expected := map[string]string{
|
|
"__NEOFS__EXPIRATION_EPOCH1": "101",
|
|
"MyAttribute": "value",
|
|
"__NEOFS__EXPIRATION_EPOCH3": "103",
|
|
"__NEOFS__EXPIRATION_EPOCH2": "102",
|
|
}
|
|
|
|
result := filterHeaders(log, req)
|
|
|
|
require.Equal(t, expected, result)
|
|
}
|