rid me
This commit is contained in:
parent
e48aef159f
commit
0b62beb4b7
3 changed files with 25 additions and 3 deletions
8
main.go
8
main.go
|
|
@ -34,7 +34,13 @@ func handleConnection(conn net.Conn, handler func(request Constants.Request, res
|
|||
return
|
||||
}
|
||||
parsed := parser.ParseIntent(raw)
|
||||
request := Constants.Request{Intent: parsed, Body: strings.SplitN(raw, "\n\n", 2)[1]}
|
||||
body := strings.SplitN(raw, "\n\n", 2)
|
||||
if len(body) < 2 {
|
||||
conn.Write(helper.StringToByteWithEnd(helper.IntentGenerator(Constants.Response{OperationSuccessClassification: Constants.INTERNALSERVERERROR, ResponseHeader: map[string]string{}, Body: "shit you sent wasnt pas bruh"})))
|
||||
return
|
||||
}
|
||||
request := Constants.Request{Intent: parsed, Body: body[1]}
|
||||
|
||||
handler(request, func(c Constants.Response) {
|
||||
conn.Write(helper.StringToByteWithEnd(helper.IntentGenerator(c)))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue