Skip to content

Commit 4d56fa8

Browse files
Update BUG_REPORT.md
1 parent a52b645 commit 4d56fa8

1 file changed

Lines changed: 64 additions & 38 deletions

File tree

BUG_REPORT/BUG_REPORT.md

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -73,65 +73,91 @@
7373

7474
---
7575

76-
### 1. ❌ API returns HTTP 200 even with empty or invalid request body
76+
### 1. ❌ API returns HTTP 200 even with invalid data text
7777

78-
- **Title**: Empty input accepted as valid
78+
- **Title**: invalid data input accepted as valid
7979
- **Environment**: `/api/rfq/upload-url-html`
8080
- **Steps to Reproduce**:
81-
1. Send empty JSON `{}` or empty `"url": ""`
81+
1. Send invalid data in text JSON
8282
- **Actual Result**: HTTP 200 OK, `isSuccess: true` but no useful result
8383
- **Expected Result**: HTTP 400 Bad Request with error details
8484
- **Severity**: High
8585
- **Priority**: High
8686

8787
---
8888

89-
### 2. ❌ Invalid URLs do not return error
89+
### 2. ❌ API accepts requests without required headers and returns HTTP 200
9090

91-
- **Title**: Invalid URL strings processed without validation error
92-
- **Environment**: `/api/rfq/upload-url-html`
93-
- **Steps to Reproduce**:
94-
1. Send `"url": "htp://invalid-url"`
95-
- **Actual Result**: 200 OK, vague response
96-
- **Expected Result**: HTTP 400 with descriptive error
97-
- **Severity**: Medium
98-
- **Priority**: Medium
91+
- **Title**: Missing authentication headers not rejected properly
92+
- **Environment**: All protected API endpoints
93+
- **Steps to Reproduce**:
94+
1. Send a request to any protected endpoint (e.g. `/api/rfq/upload-free-text`)
95+
2. Omit both `Authorization` and `ApiKey` headers
96+
- **Actual Result**:
97+
- The API responds with `HTTP 200 OK`
98+
- Response may include a vague "unauthorized" message or even `isSuccess: true`
99+
- **Expected Result**:
100+
- API should return `HTTP 401 Unauthorized`
101+
- Response body should contain a clear error message like `Missing or invalid authentication headers`
102+
- **Severity**: High
103+
- **Priority**: High
99104

100105
---
101106

102-
### 3. ❌ Missing required fields do not trigger validation errors
107+
### 3. ❌ API treats request with both `ApiKey` and `Authorization` headers as authorized, but rejects request with only `ApiKey`
103108

104-
- **Title**: Missing `text` or `url` field accepted silently
105-
- **Environment**: `/upload-free-text` and `/upload-url-html`
106-
- **Steps to Reproduce**:
107-
1. Send request without `text` or without `url`
108-
- **Actual Result**: `isSuccess: true` but no data processed
109-
- **Expected Result**: Validation error and HTTP 400 response
110-
- **Severity**: High
111-
- **Priority**: High
109+
- **Title**: API requires `Authorization` header format, ignores or rejects `ApiKey` header alone
110+
- **Environment**: All endpoints requiring authentication
111+
- **Steps to Reproduce**:
112+
1. Send request with header:
113+
`ApiKey: a7a91f48-0371-4680-b69d-7928d9c1c9ad`
114+
→ API returns HTTP 200 with unauthorized message (not authorized)
115+
2. Send request with both headers:
116+
`ApiKey: a7a91f48-0371-4680-b69d-7928d9c1c9ad`
117+
`Authorization: ApiKey a7a91f48-0371-4680-b69d-7928d9c1c9ad`
118+
→ API returns HTTP 200 and treats user as authorized
119+
- **Actual Result**: API accepts only requests with `Authorization` header in format `ApiKey <key>`. Requests with only `ApiKey` header are rejected as unauthorized, but when both headers are sent, API treats request as authorized.
120+
- **Expected Result**: Consistent authentication handling. Either accept `ApiKey` header alone or clearly reject and document that only `Authorization` header with `ApiKey` prefix is accepted. Do not mix behaviors depending on presence of both headers.
121+
- **Severity**: Medium
122+
- **Priority**: Medium
112123

113124
---
114125

115-
### 4. ❌ Malformed JSON accepted with HTTP 200
126+
### 4. ❌ API returns HTTP 200 OK for oversized request payload
116127

117-
- **Title**: Invalid JSON not rejected
118-
- **Environment**: Any endpoint
119-
- **Steps to Reproduce**:
120-
1. Send request with broken JSON syntax
121-
- **Actual Result**: 200 OK, empty or null response
122-
- **Expected Result**: HTTP 400 with JSON parse error
123-
- **Severity**: Medium
124-
- **Priority**: Medium
128+
- **Title**: API does not reject overly large `text` input
129+
- **Environment**: `/api/rfq/upload-free-text`
130+
- **Steps to Reproduce**:
131+
1. Send POST request with `text` field containing very large string (e.g., 2MB of characters)
132+
- **Actual Result**: HTTP 200 OK returned, request accepted silently without error
133+
- **Expected Result**: HTTP 413 Payload Too Large or HTTP 400 Bad Request with descriptive error message
134+
- **Severity**: Medium
135+
- **Priority**: Medium
125136

126137
---
127138

128-
### 5. ❌ API key header is case-sensitive causing unauthorized errors
139+
### 5. ❌ API accepts `topK` as a string without validation
129140

130-
- **Title**: Header name must be exactly `ApiKey`
131-
- **Environment**: All API endpoints
141+
- **Title**: `topK` parameter accepts string values silently
142+
- **Environment**: `/api/rfq/upload-url-html`, `/api/rfq/upload-free-text`
132143
- **Steps to Reproduce**:
133-
1. Send API key header as `apikey` or `Authorization`
134-
- **Actual Result**: Unauthorized error with 200 status
135-
- **Expected Result**: Clear documentation or case-insensitive header handling, plus HTTP 401 status
136-
- **Severity**: Medium
137-
- **Priority**: Medium
144+
1. Send request with `topK` as a string:
145+
```json
146+
{
147+
"url": "https://www.webstaurantstore.com/choice-24-x-18-x-1-2-green-polyethylene-cutting-board/40724185GN.html",
148+
"topK": "3",
149+
"threshold": 0.8,
150+
"enablePrivateLabelRanking": false,
151+
"enableStockProductRanking": false,
152+
"enableVendorRanking": false
153+
}
154+
```
155+
- **Actual Result**:
156+
- API returns `HTTP 200 OK`
157+
- `isSuccess: true`
158+
- No validation error, even though `topK` is a string instead of a number
159+
- **Expected Result**:
160+
- API should return `HTTP 400 Bad Request`
161+
- Error message like: "`topK` must be a number"
162+
- **Severity**: Medium
163+
- **Priority**: Medium

0 commit comments

Comments
 (0)