Skip to content

Commit

Permalink
test: update integ test assertions for user agents
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 9, 2024
1 parent 4ffcd4b commit 306327a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe("middleware-flexible-checksums", () => {

requireRequestsFrom(client).toMatch({
headers: {
"user-agent": new RegExp(`(.*?) m\/${id}$`),
"user-agent": new RegExp(`(.*?) m\/${id},E$`),
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("middleware-s3-express", () => {

requireRequestsFrom(client).toMatch({
headers: {
"user-agent": /(.*?) m\/J$/,
"user-agent": /(.*?) m\/J,E$/,
},
});

Expand Down
3 changes: 1 addition & 2 deletions packages/middleware-user-agent/src/check-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ export async function checkFeatures(
config: PreviouslyResolved,
args: BuildHandlerArguments<any>
): Promise<void> {
// eslint-disable-next-line
const request = args.request as IHttpRequest;

if (request.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("middleware-user-agent", () => {

requireRequestsFrom(doc).toMatch({
headers: {
"user-agent": /(.*?) m\/d,O,R$/,
"user-agent": /(.*?) m\/d,E,O,R$/,
},
});

Expand Down

0 comments on commit 306327a

Please sign in to comment.