Skip to content

Commit

Permalink
fix: use correct protocol when displaying function URL (#4605)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas authored May 13, 2022
1 parent a139ef1 commit 7bdf548
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/functions/netlify-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ class NetlifyFunction {
// Not sure why `settings.port` was used here nor does a valid reference exist.
// However, it remains here to serve whatever purpose for which it was added.
const port = this.settings.port || this.settings.functionsPort
const protocol = this.settings.https ? 'https' : 'http'
const url = new URL(`/.netlify/functions/${this.name}`, `${protocol}://localhost:${port}`)

const url = new URL(`/.netlify/functions/${this.name}`, `http://localhost:${port}`)
return url.href
}
}
Expand Down

1 comment on commit 7bdf548

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 286 MB

Please sign in to comment.