mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Use variables for string matching
The legacy code does case matching on these exact strings so it's better to ensure they're constant.
This commit is contained in:
parent
87ad06a5e2
commit
c3c84fdb48
3 changed files with 7 additions and 5 deletions
|
@ -177,10 +177,10 @@ func clientOffers(i *IPC, w http.ResponseWriter, r *http.Request) {
|
|||
switch resp.Error {
|
||||
case "":
|
||||
response = []byte(resp.Answer)
|
||||
case "no snowflake proxies currently available":
|
||||
case messages.StrNoProxies:
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
return
|
||||
case "timed out waiting for answer!":
|
||||
case messages.StrTimedOut:
|
||||
w.WriteHeader(http.StatusGatewayTimeout)
|
||||
return
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue