CenterForDigitalHumanities / CenterForDigitalHumanities/rerum_server_nodejs
`Content-Type` Header Processing
- Ngôn ngữ chính
- JavaScript
- Star
- 3
- Fork
- 6
- Merge trung bình
- 1 giờ 25 phút
- Pull request đã merge (30 ngày)
- 3
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Theo dõi các request handler cho /create, các endpoint update-y và /query, sau đó kiểm tra cách Content-Type và request body được phân tích. Xác minh hành vi với các request bị thiếu header, sử dụng các kiểu JSON không được hỗ trợ hoặc chứa body rỗng hay không hợp lệ; được xem là hoàn thành khi mỗi trường hợp không hợp lệ đều trả về 400 kèm thông báo hữu ích và các request JSON hợp lệ vẫn thành công mà không tạo các object rỗng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- api, backend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100