Export TLS & remove conn in request struct

This makes it possible to fully create another request outside of this module
(which Hnakra will need) and has better parity with net/http.
This commit is contained in:
2023-05-26 00:38:12 -04:00
parent 24d70951c9
commit f6d3c47816
3 changed files with 8 additions and 26 deletions

View File

@@ -52,7 +52,7 @@ func fingerprint(cert *x509.Certificate) string {
}
func profile(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
tls := r.TLS()
tls := r.TLS
if len(tls.PeerCertificates) == 0 {
w.WriteHeader(gemini.StatusCertificateRequired, "Certificate required")
return
@@ -68,7 +68,7 @@ func profile(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
}
func changeUsername(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
tls := r.TLS()
tls := r.TLS
if len(tls.PeerCertificates) == 0 {
w.WriteHeader(gemini.StatusCertificateRequired, "Certificate required")
return