CenterForDigitalHumanities / CenterForDigitalHumanities/rerum_server_nodejs
`Content-Type` Header Processing
- 主要言語
- JavaScript
- スター
- 3
- フォーク
- 6
- 平均マージ
- 1時間 25分
- マージ済み PR(30日)
- 3
説明
The bug is that RERUM will create an empty object in the following scenario.

> Note: If you do not omit the 'Content-Type' header from this request, RERUM correctly responds with a 400 and a good message.
When a request to `/create` (and likely others) happens and the request does not contain "Content-Type: application/json" but the body is a valid string or empty, RERUM processes the request and creates an empty object in the database. It responds 201 with that empty object as JSON in the body, and client applications receive the 201 with the empty object.
When a request to /create, any of the update-y endpoints, or /query comes in, it MUST contain the 'Content-Type' header, the value for the header has to a supported JSON type (application/json), the body MUST NOT be empty and MUST contain valid JSON with at least on key:value pair.
If any of these conditions are not met, RERUM should respond 400 - Bad Request with as detailed of a message as is useful.
コントリビューションガイド
調査の方向性
Trace the request handlers for /create, the update-y endpoints, and /query, then inspect how Content-Type and request bodies are parsed. Verify the behavior with requests missing the header, using unsupported JSON types, or containing empty or invalid bodies; done means each invalid case returns 400 with a useful message and valid JSON requests still succeed without creating empty objects.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100