diff options
| author | Hugo Wetterberg <[email protected]> | 2021-01-05 20:16:33 +0100 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-01-05 18:33:36 -0500 |
| commit | efef44c2f9939f8095247da56018bda711e14801 (patch) | |
| tree | aa6ad38d3ef9649bfaa6f9e6679b0f209dee0787 /text.go | |
| parent | client: Close connection for unsuccessful responses (diff) | |
| download | go-gemini-efef44c2f9939f8095247da56018bda711e14801.tar.xz go-gemini-efef44c2f9939f8095247da56018bda711e14801.zip | |
server: abort request handling on bad requests
A request to a hostname that hasn't been registered with the server
currently results in a nil pointer deref panic in server.go:215 as
request handling continues even if ReadRequest() returns an error.
This change changes all if-else error handling in Server.respond() to
a WriteStatus-call and early return. This makes it clear when request
handling is aborted (and actually aborts when ReadRequest() fails).
Diffstat (limited to 'text.go')
0 files changed, 0 insertions, 0 deletions