Skip to content

Commit

Permalink
chore(credential-provider-http): remove warning when response content…
Browse files Browse the repository at this point in the history
…-type is not application/json (#6192)
  • Loading branch information
trivikr authored Jun 12, 2024
1 parent 188a4d8 commit c7523db
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/credential-provider-http/src/fromHttp/requestHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ export function createGetRequest(url: URL): HttpRequest {
* @internal
*/
export async function getCredentials(response: HttpResponse, logger?: Logger): Promise<AwsCredentialIdentity> {
const contentType = response?.headers["content-type"] ?? response?.headers["Content-Type"] ?? "";

if (!contentType.includes("json")) {
const warn: (warning: string) => void =
logger?.constructor?.name === "NoOpLogger" || !logger ? console.warn : logger.warn;
warn(
"HTTP credential provider response header content-type was not application/json. Observed: " + contentType + "."
);
}

const stream = sdkStreamMixin(response.body);
const str = await stream.transformToString();

Expand Down

0 comments on commit c7523db

Please sign in to comment.