Skip to content

Commit

Permalink
Fix echo server didn't return after error.
Browse files Browse the repository at this point in the history
  • Loading branch information
wi1dcard committed Mar 16, 2024
1 parent b243ddb commit 7dca465
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/echo-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,25 @@ func echoServer(w http.ResponseWriter, req *http.Request) {
data, ok := metadata.FromContext(req.Context())
if !ok {
http.Error(w, "failed to get context", http.StatusInternalServerError)
return
}

ja3, err := fingerprint.JA3Fingerprint(data)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}

ja4, err := fingerprint.JA4Fingerprint(data)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}

http2, err := fingerprint.HTTP2Fingerprint(data)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}

if req.URL.Path == "/json" {
Expand Down

0 comments on commit 7dca465

Please sign in to comment.