Skip to content

Commit

Permalink
fix: http1.1 content-length
Browse files Browse the repository at this point in the history
  • Loading branch information
pagpeter committed Sep 28, 2024
1 parent 0c09203 commit da37665
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion connection_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func respondToHTTP1(conn net.Conn, resp Response) {
}

res1 := "HTTP/1.1 200 OK\r\n"
res1 += "Content-Length: " + fmt.Sprintf("%v\r\n", len(res1))
res1 += "Content-Length: " + fmt.Sprintf("%v\r\n", len(res))
res1 += "Content-Type: " + ctype + "; charset=utf-8\r\n"
if isAdmin {
res1 += "Access-Control-Allow-Origin: *\r\n"
Expand Down
2 changes: 1 addition & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Router(path string, res Response) ([]byte, string) {
res.TCPIP = v.(TCPIPDetails)
}
res.TLS.JA4 = CalculateJa4(res.TLS)
// res.Donate = "Please consider donating to keep this API running."
res.Donate = "Please consider donating to keep this API running. Visit https://tls.peet.ws"
Log(fmt.Sprintf("%v %v %v %v %v", cleanIP(res.IP), res.Method, res.HTTPVersion, res.path, res.TLS.JA3Hash))
// if GetUserAgent(res) == "" {
// return []byte("{\"error\": \"No user-agent\"}"), "text/html"
Expand Down
2 changes: 1 addition & 1 deletion structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Http2Details struct {
}

type Response struct {
// Donate string `json:"donate"`
Donate string `json:"donate"`
IP string `json:"ip"`
HTTPVersion string `json:"http_version"`
path string `json:"-"`
Expand Down

0 comments on commit da37665

Please sign in to comment.