Collection title not considered when a charset is set during a collection's creation

api resource concerned : /api/collections

Without charset :

Command:

curl -v -X POST "http://localhost:5000/api/collections" --header "Content-Type: application/json" --data-raw "{\"title\": \"Another Collection\"}"

Response:

{
  "created": "2024-01-24T10:03:22.252820+00:00",
  "description": "A sequence of geolocated pictures",
  "extent": {
    "spatial": {
      "bbox": [
        [
          -180.0,
          -90.0,
          180.0,
          90.0
        ]
      ]
    },
    "temporal": {
      "interval": [
        [
          null,
          null
        ]
      ]
    }
  },
  "geovisio:status": "waiting-for-process",
  "id": "775078ab-0753-461c-ace5-5af14dd2f267",
  "keywords": [
    "pictures",
    "Another Collection"
  ],
  "license": "proprietary",
  "links": [
    {
      "href": "http://localhost:5000/api/collections/775078ab-0753-461c-ace5-5af14dd2f267/items",
      "rel": "items",
      "title": "Pictures in this sequence",
      "type": "application/geo+json"
    },
    {
      "href": "http://localhost:5000/api/",
      "rel": "parent",
      "title": "Instance catalog",
      "type": "application/json"
    },
    {
      "href": "http://localhost:5000/api/",
      "rel": "root",
      "title": "Instance catalog",
      "type": "application/json"
    },
    {
      "href": "http://localhost:5000/api/collections/775078ab-0753-461c-ace5-5af14dd2f267",
      "rel": "self",
      "title": "Metadata of this sequence",
      "type": "application/json"
    }
  ],
  "providers": [
    {
      "name": "Default account",
      "roles": [
        "producer"
      ]
    }
  ],
  "stac_extensions": [
    "https://stac-extensions.github.io/stats/v0.2.0/schema.json"
  ],
  "stac_version": "1.0.0",
  "stats:items": {
    "count": 0
  },
  "title": "Another Collection",
  "type": "Collection"
}

With charset :

Command:

curl -v -X POST "http://localhost:5000/api/collections" --header "Content-Type: application/json;charset=uft8" --data-raw "{\"title\": \"My First Collection\"}"

Response:

{
  "created": "2024-01-24T09:56:31.225719+00:00",
  "description": "A sequence of geolocated pictures",
  "extent": {
    "spatial": {
      "bbox": [
        [
          -180.0,
          -90.0,
          180.0,
          90.0
        ]
      ]
    },
    "temporal": {
      "interval": [
        [
          null,
          null
        ]
      ]
    }
  },
  "geovisio:status": "waiting-for-process",
  "id": "53ac1b53-1918-4db2-a07f-34b85e044ab7",
  "keywords": [
    "pictures",
    "None"
  ],
  "license": "proprietary",
  "links": [
    {
      "href": "http://localhost:5000/api/collections/53ac1b53-1918-4db2-a07f-34b85e044ab7/items",
      "rel": "items",
      "title": "Pictures in this sequence",
      "type": "application/geo+json"
    },
    {
      "href": "http://localhost:5000/api/",
      "rel": "parent",
      "title": "Instance catalog",
      "type": "application/json"
    },
    {
      "href": "http://localhost:5000/api/",
      "rel": "root",
      "title": "Instance catalog",
      "type": "application/json"
    },
    {
      "href": "http://localhost:5000/api/collections/53ac1b53-1918-4db2-a07f-34b85e044ab7",
      "rel": "self",
      "title": "Metadata of this sequence",
      "type": "application/json"
    }
  ],
  "providers": [
    {
      "name": "Default account",
      "roles": [
        "producer"
      ]
    }
  ],
  "stac_extensions": [
    "https://stac-extensions.github.io/stats/v0.2.0/schema.json"
  ],
  "stac_version": "1.0.0",
  "stats:items": {
    "count": 0
  },
  "title": "None",
  "type": "Collection"
}

Bug description

When the charset is set in the request header, we see that in the response, the title has not been set and has the value None.

Expected behavior

As in the case without charset, the title specified in the request body should be considered.

Assignee Loading
Time tracking Loading