Prepending a slash to user input url if missing. (#547)

* Prepending a slash to user input url if missing.

* Adding the url slash check for spec.
This commit is contained in:
smruthi2187
2018-03-26 12:31:02 -07:00
committed by Soam Vasani
parent 03046170dc
commit 77be3379b2
3 changed files with 11 additions and 0 deletions
+4
View File
@@ -274,6 +274,10 @@ func fnCreate(c *cli.Context) error {
if len(triggerUrl) == 0 {
return nil
}
if !strings.HasPrefix(triggerUrl, "/") {
triggerUrl = fmt.Sprintf("/%s", triggerUrl)
}
method := c.String("method")
if len(method) == 0 {
method = "GET"