Skip to content

Commit

Permalink
fix: ensure target starts with http or https
Browse files Browse the repository at this point in the history
  • Loading branch information
suphon-t committed Jan 15, 2024
1 parent 060fe8f commit 9b5fd18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/daemon/dotlocal.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func (d *DotLocal) CreateMapping(opts internal.MappingOptions) (internal.Mapping
if opts.PathPrefix == "" {
opts.PathPrefix = "/"
}
if !strings.HasPrefix(opts.Target, "http://") && !strings.HasPrefix(opts.Target, "https://") {
opts.Target = "http://" + opts.Target
}
key := internal.MappingKey{
Host: opts.Host,
PathPrefix: opts.PathPrefix,
Expand Down

0 comments on commit 9b5fd18

Please sign in to comment.