integration: Don't send Link header field for resource under /css/
This commit is contained in:
parent
80743ddc7b
commit
ff60cc6b71
|
@ -8,6 +8,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -494,7 +495,9 @@ func TestH2H1SNI(t *testing.T) {
|
||||||
func TestH2H1ServerPush(t *testing.T) {
|
func TestH2H1ServerPush(t *testing.T) {
|
||||||
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
st := newServerTester(nil, t, func(w http.ResponseWriter, r *http.Request) {
|
||||||
// only resources marked as rel=preload are pushed
|
// only resources marked as rel=preload are pushed
|
||||||
w.Header().Add("Link", "</css/main.css>; rel=preload, </foo>, </css/theme.css>; rel=preload")
|
if !strings.HasPrefix(r.URL.Path, "/css/") {
|
||||||
|
w.Header().Add("Link", "</css/main.css>; rel=preload, </foo>, </css/theme.css>; rel=preload")
|
||||||
|
}
|
||||||
})
|
})
|
||||||
defer st.Close()
|
defer st.Close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue