5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:01:52 +08:00

Windows switch scheme: https -> http (#1255)

This commit is contained in:
Stefanos Papadakis 2022-03-14 20:58:43 +02:00 committed by GitHub
parent ea4d479be3
commit e78557ec24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
bindings: appBindings, bindings: appBindings,
dispatcher: dispatcher, dispatcher: dispatcher,
ctx: ctx, ctx: ctx,
startURL: "https://wails.localhost/", startURL: "http://wails.localhost/",
} }
bindingsJSON, err := appBindings.ToJSON() bindingsJSON, err := appBindings.ToJSON()
@ -352,7 +352,7 @@ func (f *Frontend) processRequest(req *edge.ICoreWebView2WebResourceRequest, arg
//Get the request //Get the request
uri, _ := req.GetUri() uri, _ := req.GetUri()
res, err := common.ProcessRequest(uri, f.assets, "https", "wails.localhost") res, err := common.ProcessRequest(uri, f.assets, "http", "wails.localhost")
if err == common.ErrUnexpectedScheme { if err == common.ErrUnexpectedScheme {
// In this case we should let the WebView2 handle the request with its default handler // In this case we should let the WebView2 handle the request with its default handler
return return
@ -362,7 +362,7 @@ func (f *Frontend) processRequest(req *edge.ICoreWebView2WebResourceRequest, arg
// for all other platforms to improve security. // for all other platforms to improve security.
return // Let WebView2 handle the request with its default handler return // Let WebView2 handle the request with its default handler
} else if err != nil { } else if err != nil {
path := strings.Replace(uri, "https://wails.localhost", "", 1) path := strings.Replace(uri, "http://wails.localhost", "", 1)
f.logger.Error("Error processing request '%s': %s (HttpResponse=%s)", path, err, res) f.logger.Error("Error processing request '%s': %s (HttpResponse=%s)", path, err, res)
} }