We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc611c6 commit 1bef69cCopy full SHA for 1bef69c
option/requestoption.go
@@ -6,7 +6,6 @@ import (
6
"bytes"
7
"fmt"
8
"io"
9
- "log"
10
"net/http"
11
"net/url"
12
"strings"
@@ -28,10 +27,11 @@ type RequestOption = requestconfig.RequestOption
28
27
// For security reasons, ensure that the base URL is trusted.
29
func WithBaseURL(base string) RequestOption {
30
u, err := url.Parse(base)
31
- if err != nil {
32
- log.Fatalf("failed to parse BaseURL: %s\n", err)
33
- }
34
return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error {
+ if err != nil {
+ return fmt.Errorf("requestoption: WithBaseURL failed to parse url %s\n", err)
+ }
+
35
if u.Path != "" && !strings.HasSuffix(u.Path, "/") {
36
u.Path += "/"
37
}
0 commit comments