kit-data-manager / kit-data-manager/pit-service
Missing content type header when using simple format
- Dominant language
- Java
- Stars
- 3
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When the request has the header `accept:application/json`, the response contains the header `content-type: application/json`. This is missing for the simple record format, thus breaking Spring HTTPInterface clients. I did not yet test other operations such as UPDATE.
**To Reproduce**
```bash
curl -X 'POST' \
'https://typed-pid-maker.datamanager.kit.edu/preview/api/v1/pit/pid/?dryrun=false' \
-sSi -H 'Accept:application/vnd.datamanager.pid.simple+json' \
-H 'Content-Type: application/vnd.datamanager.pid.simple+json' \
-d '{
"pid":"test",
"record":[
{"key":"21.T11148/397d831aa3a9d18eb52c","value":"2025-12-04T15:56:21.367856Z"},
{"key":"21.T11148/82e2503c49209e987740","value":"{\"sha256sum\": \"sha256 4b78da033dcc268310784d3f70d5523b192f26fa42fef397ebe3aa18cfdefe53\"}"},
{"key":"21.T11148/c692273deb2772da307f","value":"v0"},
{"key":"21.T11148/aafd5fb4c7222e2d950a","value":"2025-12-04T15:56:21.367856Z"},
{"key":"21.T11148/b8457812905b83046284","value":"http://localhost:8095/pid/null"},
{"key":"21.T11148/1c699a5d1b4ad3ba4956","value":"21.T11148/ca9fd0b2414177b79ac2"},
{"key":"21.T11148/6ae999552a0d2dca14d6","value":"PersonType"},
{"key":"21.T11148/076759916209e5d62bd5","value":"21.T11148/b9b76f887845e32d29f7"},
{"key":"21.T11148/2f314c8fe5fb6a0063a8","value":"https://spdx.org/license/CC0-1.0/"}
]
}'
```
Response
```
HTTP/2 201
date: Thu, 04 Dec 2025 16:37:14 GMT
etag: "1066061072"
vary: Origin
vary: Access-Control-Request-Method
vary: Access-Control-Request-Headers
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 0
{"pid":"sandboxed/0d7b09dd-4775-43e4-bb2e-78b2eaa01d6c","record":[{"key":"21.T11148/397d831aa3a9d18eb52c","value":"2025-12-04T15:56:21.367856Z"},{"key":"21.T11148/82e2503c49209e987740","value":"{\"sha256sum\": \"sha256 4b78da033dcc268310784d3f70d5523b192f26fa42fef397ebe3aa18cfdefe53\"}"},{"key":"21.T11148/aafd5fb4c7222e2d950a","value":"2025-12-04T15:56:21.367856Z"},{"key":"21.T11148/c692273deb2772da307f","value":"v0"},{"key":"21.T11148/b8457812905b83046284","value":"http://localhost:8095/pid/null"},{"key":"21.T11148/1c699a5d1b4ad3ba4956","value":"21.T11148/ca9fd0b2414177b79ac2"},{"key":"21.T11148/6ae999552a0d2dca14d6","value":"PersonType"},{"key":"21.T11148/076759916209e5d62bd5","value":"21.T11148/b9b76f887845e32d29f7"},{"key":"21.T11148/2f314c8fe5fb6a0063a8","value":"https://spdx.org/license/CC0-1.0/"}]}
```
**Expected behavior**
The request should return a correct `content-type` header
Contributor guide
Research direction
Start by reproducing the POST request to the /preview/api/v1/pit/pid/ endpoint with the simple JSON media type and inspect how its response headers are produced. Compare it with the application/json response behavior; done means the simple-format response includes the correct content-type header and the relevant request behavior is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100