1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00

Go back to 503 rejections instead of TLS aborts

This commit is contained in:
Kane York 2017-11-13 15:57:20 -08:00
parent 0d3d8b5868
commit 360420022d
5 changed files with 5 additions and 15 deletions

View file

@ -2,7 +2,6 @@ package server // import "github.com/FrankerFaceZ/FrankerFaceZ/socketserver/serv
import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
@ -254,15 +253,6 @@ func shouldRejectConnection() bool {
return false
}
var errEarlyTLSReject = errors.New("over capacity")
func TLSEarlyReject(*tls.ClientHelloInfo) (*tls.Config, error) {
if shouldRejectConnection() {
return nil, errEarlyTLSReject
}
return nil, nil
}
// HTTPHandleRootURL is the http.HandleFunc for requests on `/`.
// It either uses the SocketUpgrader or writes out the BannerHTML.
func HTTPHandleRootURL(w http.ResponseWriter, r *http.Request) {
@ -283,6 +273,7 @@ func HTTPHandleRootURL(w http.ResponseWriter, r *http.Request) {
conn, err := SocketUpgrader.Upgrade(w, r, nil)
if err != nil {
w.WriteHeader(400)
fmt.Fprintf(w, "error: %v", err)
return
}