Skip to content

@aws-sdk/client-cloudfront ListDistributionsCommand returns incorrect "HttpVersion" valueΒ #6605

@Jianru-Lin

Description

@Jianru-Lin

Checkboxes for prior research

Describe the bug

I am working on integrating the Cloudfront service with our internal system.

However, I found that the ListDistributionsCommand returns the incorrect "HttpVersion" value.

It returns "HTTP2and3" instead of "http2and3".

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.9.0

Reproduction Steps

  1. Log in to the AWS CloudFront dashboard.
  2. Create a new distribution; Make sure to select both HTTP/2 and HTTP/3 in the "Supported HTTP versions" section, then submit to create.
  3. Write a minimal node.js code with @aws-sdk/client-cloudfront to send a ListDistributionsCommand request. Check the response to reproduce the bug.

Observed Behavior

This is what I got from aws server:

{
    "$metadata": {
        "httpStatusCode": 200,
        "requestId": "1a551a4f-8a33-4a57-9186-ed4461621524",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "DistributionList": {
        "Marker": "",
        "MaxItems": 100,
        "IsTruncated": false,
        "Quantity": 1,
        "Items": [
            {
                "Id": "E39HM9L49VTJZO",
                // ... some fields
                "HttpVersion": "HTTP2and3", // πŸ‘ˆ this is wrong, should be "http2and3"
                // ... some fields
            }
        ]
    }
}

Expected Behavior

The value of the "HttpVersion" field should be "http2and3" instead of "HTTP2and3".

This value is incorrect because it does not align with two things:

  • It does not follow the type declaration of /node_modules/@aws-sdk/client-cloudfront/dist-types/models/models_0.d.ts
  • It does not follow what GetDistributionCommand returns (it returns the right value "http2and3")

Possible Solution

No response

Additional Information/Context

For reference purpose, this is what defined in /node_modules/@aws-sdk/client-cloudfront/dist-types/models/models_0.d.ts:

export declare const HttpVersion: {
    readonly http1_1: "http1.1";
    readonly http2: "http2";
    readonly http2and3: "http2and3";
    readonly http3: "http3";
};

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions