misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-09-29 12:25:13 +02:00
commit 9469c37ef0
No known key found for this signature in database
GPG key ID: 82E42E7F3B34C97E
2 changed files with 16 additions and 8 deletions

View file

@ -26,6 +26,10 @@ type HTTPRequest struct {
Body []byte `json:"body"`
}
func (r HTTPRequest) IsType(ctype string) bool {
return strings.Contains(r.ContentType, ctype)
}
type HTTPResponse struct {
Protocol string `json:"protocol"`
Status string `json:"status"`
@ -37,6 +41,10 @@ type HTTPResponse struct {
TransferEncoding []string `json:"transfer_encoding"`
}
func (r HTTPResponse) IsType(ctype string) bool {
return strings.Contains(r.ContentType, ctype)
}
func toSerializableRequest(req *http.Request) HTTPRequest {
body := []byte(nil)
ctype := "?"