Fixes error messaging for net-post to be more accurate and bumps version to 1.2.3

This commit is contained in:
sloum 2022-09-19 09:20:31 -07:00
parent 52531d3d4c
commit c778761b58
2 changed files with 3 additions and 3 deletions

4
lib.go
View File

@ -2517,7 +2517,7 @@ var stdLibrary = vars{
},
"net-post": func(a ...expression) expression {
if len(a) < 2 {
return []expression{false, "'net-post' expects a url string and a string or list of bytes representing the post body/data, too few values were given"}
return []expression{false, "'net-post' expects a url string and a string or an open io-handle containing the post body/data, too few values were given"}
}
u, err := url.Parse(String(a[0], false))
if err != nil {
@ -2593,7 +2593,7 @@ var stdLibrary = vars{
}
return []expression{true, string(resp)}
default:
return []expression{false, "'net-post' was given a URL for an unsupported scheme: " + u.Scheme + ". Consider using 'net-conn' instead"}
return []expression{false, "'net-post' was given a url for an unsupported scheme: " + u.Scheme + ". Consider using 'net-conn' instead"}
}
},
"net-get": func(a ...expression) expression {

View File

@ -18,7 +18,7 @@ import (
ln "github.com/peterh/liner"
)
const version = "1.2.2"
const version = "1.2.3"
const globalLibPath = "/usr/local/lib/slope/modules/"