From 9b5fd183ab6b7eb0c7116475391988d4aa5deb67 Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong <8080853+suphon-t@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:29:16 +0700 Subject: [PATCH] fix: ensure target starts with http or https --- internal/daemon/dotlocal.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/daemon/dotlocal.go b/internal/daemon/dotlocal.go index 2b6e814..844b8d9 100644 --- a/internal/daemon/dotlocal.go +++ b/internal/daemon/dotlocal.go @@ -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,