Skip to content

HTTP binding fails with multiple Content-Encoding headers #1414

@FreuMi

Description

@FreuMi

Description / Problem

When consuming HTTP endpoints that return responses with multiple Content-Encoding values (e.g., Content-Encoding: gzip, br), the HTTP binding in node-wot passes compressed or partially decoded data directly to codecs.

Since codecs expect plain, uncompressed payloads, this results in parsing/validation failures such as:

Invalid value according to DataSchema

Example

Here is an example TD to reproduce the issue:

{
  "@context": "https://www.w3.org/2022/wot/td/v1.1",
  "title": "dateTimeAPI",
  "securityDefinitions": { "nosec_sc": { "scheme": "nosec" } },
  "security": ["nosec_sc"],
  "properties": {
    "currentDateTime": {
      "description": "Get current datetime",
      "readOnly": true,
      "type": "object",
      "properties": {
        "datetime": { "type": "string", "format": "date-time" }
      },
      "forms": [
        {
          "href": "https://aisenseapi.com/services/v1/datetime",
          "contentType": "application/json"
        }
      ]
    }
  }
}

Notes

See #1413 for the initial discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-httpIssues related to http protocol binding

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions