allow empty headers on DataFromReader (#2121)
This commit is contained in:
committed by
thinkerou
parent
2ee0e96394
commit
b52a1a1588
@@ -0,0 +1,23 @@
|
||||
// Copyright 2019 Gin Core Team. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package render
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestReaderRenderNoHeaders(t *testing.T) {
|
||||
content := "test"
|
||||
r := Reader{
|
||||
ContentLength: int64(len(content)),
|
||||
Reader: strings.NewReader(content),
|
||||
}
|
||||
err := r.Render(httptest.NewRecorder())
|
||||
require.NoError(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user