Skip to content

Commit

Permalink
fixing connect bug of reqmod
Browse files Browse the repository at this point in the history
  • Loading branch information
MarwanGalal746 committed Nov 1, 2022
1 parent b95ade0 commit 17e7101
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions service/services/clamav/clamav.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func (c *Clamav) Processing(partial bool) (int, interface{}, map[string]string,
msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if c.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, c.generalFunc.ReturningHttpMessageWithFile(c.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down
6 changes: 6 additions & 0 deletions service/services/cloudmersive/cloudmersive.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func (c *CloudMersive) Processing(partial bool) (int, interface{}, map[string]st
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if c.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, c.generalFunc.ReturningHttpMessageWithFile(c.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down
8 changes: 7 additions & 1 deletion service/services/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func (e *Echo) Processing(partial bool) (int, interface{}, map[string]string, ma
logging.Logger.Info(e.serviceName + " service has stopped processing partially")
return utils.Continue, nil, nil, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

isGzip := false

//extracting the file from http message
Expand All @@ -35,6 +34,13 @@ func (e *Echo) Processing(partial bool) (int, interface{}, map[string]string, ma
return utils.InternalServerErrStatusCodeStr, nil, serviceHeaders,
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if e.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, e.generalFunc.ReturningHttpMessageWithFile(e.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down
6 changes: 6 additions & 0 deletions service/services/grayimages/grayimages.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func (g *Grayimages) Processing(partial bool) (int, interface{}, map[string]stri
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if g.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, g.generalFunc.ReturningHttpMessageWithFile(g.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down
7 changes: 7 additions & 0 deletions service/services/hashlookup/hashlookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ func (h *Hashlookup) Processing(partial bool) (int, interface{}, map[string]stri
return utils.InternalServerErrStatusCodeStr, nil, serviceHeaders,
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if h.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, h.generalFunc.ReturningHttpMessageWithFile(h.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down
6 changes: 6 additions & 0 deletions service/services/virustotal/virustotal.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func (v *Virustotal) Processing(partial bool) (int, interface{}, map[string]stri
msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//if the http method is Connect, return the request as it is because it has no body
if v.httpMsg.Request.Method == http.MethodConnect {
return utils.OkStatusCodeStr, v.generalFunc.ReturningHttpMessageWithFile(v.methodName, file.Bytes()),
serviceHeaders, msgHeadersBeforeProcessing, msgHeadersAfterProcessing, vendorMsgs
}

//getting the extension of the file
var contentType []string
if len(contentType) == 0 {
Expand Down

0 comments on commit 17e7101

Please sign in to comment.