mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
broker and proxy must not reject client offers with no ICE candidates
Fixes #40371. Partially reverts !141.
This commit is contained in:
parent
9ff205dd7f
commit
8792771cdc
4 changed files with 0 additions and 35 deletions
|
@ -139,13 +139,6 @@ func clientOffers(i *IPC, w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
err = validateSDP(body)
|
||||
if err != nil {
|
||||
log.Println("Error client SDP: ", err.Error())
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
// Handle the legacy version
|
||||
//
|
||||
// We support two client message formats. The legacy format is for backwards
|
||||
|
|
|
@ -137,14 +137,6 @@ func TestBroker(t *testing.T) {
|
|||
r, err := http.NewRequest("POST", "snowflake.broker/client", data)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("with HTTP Bad Request when client offer contains invalid SDP", func() {
|
||||
data, err = createClientOffer("fake", NATUnknown, "")
|
||||
invalidRequest, err := http.NewRequest("POST", "snowflake.broker/client", data)
|
||||
So(err, ShouldBeNil)
|
||||
clientOffers(i, w, invalidRequest)
|
||||
So(w.Code, ShouldEqual, http.StatusBadRequest)
|
||||
})
|
||||
|
||||
Convey("with error when no snowflakes are available.", func() {
|
||||
clientOffers(i, w, r)
|
||||
So(w.Code, ShouldEqual, http.StatusOK)
|
||||
|
@ -246,14 +238,6 @@ client-sqs-ips
|
|||
So(err, ShouldBeNil)
|
||||
r.Header.Set("Snowflake-NAT-TYPE", "restricted")
|
||||
|
||||
Convey("with HTTP Bad Request when client offer contains invalid SDP", func() {
|
||||
invalidOffer := bytes.NewReader([]byte("{test}"))
|
||||
invalidRequest, err := http.NewRequest("POST", "snowflake.broker/client", invalidOffer)
|
||||
So(err, ShouldBeNil)
|
||||
clientOffers(i, w, invalidRequest)
|
||||
So(w.Code, ShouldEqual, http.StatusBadRequest)
|
||||
})
|
||||
|
||||
Convey("with 503 when no snowflakes are available.", func() {
|
||||
clientOffers(i, w, r)
|
||||
So(w.Code, ShouldEqual, http.StatusServiceUnavailable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue