eclipse-thingweb / eclipse-thingweb/node-wot

HTTP binding fails with multiple Content-Encoding headers

Open
#1,414 3 comments 2 reactions 0 assignees View on GitHub
binding-http bug
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

#### 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:
```json
{
"@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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.