mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
refact: refactored several strings.Trim calls to core.Trim
This commit is contained in:
parent
5189068cd3
commit
ca9f4f0945
10 changed files with 35 additions and 23 deletions
|
@ -6,6 +6,8 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/elazarl/goproxy"
|
||||
|
||||
"github.com/evilsocket/bettercap-ng/core"
|
||||
)
|
||||
|
||||
type JSResponse struct {
|
||||
|
@ -47,7 +49,7 @@ func (j *JSResponse) ToResponse(req *http.Request) (resp *http.Response) {
|
|||
resp = goproxy.NewResponse(req, j.ContentType, j.Status, j.Body)
|
||||
if j.Headers != "" {
|
||||
for _, header := range strings.Split(j.Headers, "\n") {
|
||||
header = strings.Trim(header, "\n\r\t ")
|
||||
header = core.Trim(header)
|
||||
if header == "" {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue