Skip to content

Commit

Permalink
test(middleware-host-header): add test for :authority header in integ…
Browse files Browse the repository at this point in the history
… test (#5374)
  • Loading branch information
siddsriv committed Oct 17, 2023
1 parent 64eacb7 commit 3f121a1
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,26 @@ describe("middleware-host-header", () => {

expect.hasAssertions();
});

it("should set the authority header when using http2", async () => {
const client = new SageMaker({ region: "us-west-2" });

requireRequestsFrom(client).toMatch({
hostname: "api.sagemaker.us-west-2.amazonaws.com",
headers: {
":authority": "api.sagemaker.us-west-2.amazonaws.com",
},
});

client.config.requestHandler.metadata = {
handlerProtocol: "h2",
};

await client.describeCompilationJob({
CompilationJobName: "compile-something",
});

expect.hasAssertions();
});
});
});

0 comments on commit 3f121a1

Please sign in to comment.