Skip to content

Commit

Permalink
Make sure to strip the scheme from the index URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Nov 11, 2024
1 parent eee541f commit 2071a9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions node/src/api/opensearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ function isVisible(doc, { allowPrivate, allowUnpublished }) {

function initRequest(path) {
const endpoint = openSearchEndpoint();
let hostname;
try {
({ hostname } = new URL(endpoint));
} catch {
hostname = endpoint;
}

return new HttpRequest({
method: "GET",
hostname: endpoint,
hostname,
headers: {
Host: endpoint,
Host: hostname,
"Content-Type": "application/json",
},
path: path,
Expand Down

0 comments on commit 2071a9a

Please sign in to comment.