mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Added tests to check large read guards
This commit is contained in:
parent
1d76d3ca2e
commit
0842dad38e
2 changed files with 31 additions and 7 deletions
|
@ -178,6 +178,16 @@ func TestBroker(t *testing.T) {
|
|||
proxyAnswers(ctx, w, r)
|
||||
So(w.Code, ShouldEqual, http.StatusBadRequest)
|
||||
})
|
||||
|
||||
Convey("with error if the proxy writes too much data", func() {
|
||||
data := bytes.NewReader(make([]byte, 100001, 100001))
|
||||
r, err := http.NewRequest("POST", "snowflake.broker/answer", data)
|
||||
r.Header.Set("X-Session-ID", "test")
|
||||
So(err, ShouldBeNil)
|
||||
proxyAnswers(ctx, w, r)
|
||||
So(w.Code, ShouldEqual, http.StatusBadRequest)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue