Skip to content

Commit 33748b0

Browse files
committed
reqbuild: only append insecure when scheme is https
1 parent d5fd60b commit 33748b0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

render/httpmodel.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ func (r *HTTPRequest) CurlCommand(scheme string, backend *Backend) string {
162162
}
163163

164164
// Default parameters
165-
s.WriteString(" -qsv -k -o /dev/null")
165+
s.WriteString(" -qsv")
166+
if scheme == "https://" {
167+
s.WriteString(" -k")
168+
}
169+
s.WriteString(" -o /dev/null")
166170

167171
// Connect-to
168172
// --connect-to HOST1:PORT1:HOST2:PORT2
@@ -213,7 +217,9 @@ func (r *HTTPRequest) HurlFile(scheme string, backend *Backend) string {
213217
}
214218

215219
// Options
216-
s.WriteString("\n[Options]\ninsecure: true\n")
220+
if scheme == "https://" {
221+
s.WriteString("\n[Options]\ninsecure: true\n")
222+
}
217223

218224
// Connect-to
219225
// --connect-to HOST1:PORT1:HOST2:PORT2

0 commit comments

Comments
 (0)