mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
parent
75d35ac2f6
commit
e07761eb33
@ -161,7 +161,7 @@ func (s *ServerConfig) GetVersionEndpoint() string {
|
||||
|
||||
// ParseEndpoint ensures the endpoint is valid.
|
||||
func (s *ServerConfig) ParseEndpoint() error {
|
||||
nurl, err := url.Parse(s.Endpoint)
|
||||
nurl, err := url.ParseRequestURI(s.Endpoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -183,6 +184,9 @@ func (o *InitOptions) createFiles() error {
|
||||
}
|
||||
}
|
||||
if o.Endpoint != "" {
|
||||
if _, err := url.ParseRequestURI(o.Endpoint); err != nil {
|
||||
return errors.Wrap(err, "error validating endpoint URL")
|
||||
}
|
||||
config.ServerConfig.Endpoint = o.Endpoint
|
||||
}
|
||||
if o.AdminSecret != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user