Skip to content

Commit 26e9361

Browse files
committed
fix url protocol extraction
1 parent 65081dc commit 26e9361

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

jb-postman.groovy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ iff.eachLine {
2929
req.put("method", l[0..3])
3030
def rawUrl = l.split(" ")[1]
3131
url.put("raw", rawUrl)
32-
url.put("host",rawUrl.split("/")?[0]?.split("\\."))
32+
if (rawUrl.contains("://")) {
33+
def extUrl = rawUrl.split("://")
34+
url.put("protocol", extUrl[0])
35+
url.put("host", extUrl[1].split("/")?[0]?.split("\\."))
36+
} else {
37+
url.put("host",rawUrl.split("/")?[0]?.split("\\."))
38+
39+
}
3340
// assumption - there should be no url encoding going here since jb does it for you
3441
if (!rawUrl.contains("?")) break
3542
rawUrl.split("\\?")?[1].split("&")?.each {

0 commit comments

Comments
 (0)