api-manager
api-manager copied to clipboard
Enforce MIME Type Validation for Documentation Uploads via Publisher REST API
Current Limitation
The Publisher REST API currently allows uploading documentation files for both APIs and API Products without validating the MIME type of the uploaded files. This may result in inconsistent handling or unsupported file formats being uploaded
Suggested Improvement
Add MIME type validation during documentation uploads in the Publisher REST API for both of the following endpoints:
-
POST /apis/{apiId}/documents/{documentId}/content -
POST /api-products/{productId}/documents/{documentId}/content
Enhancement details:
- Inspect and validate the MIME type of the uploaded input stream against a predefined whitelist of supported types.
- Reject uploads with unsupported MIME types by returning an error response
Version
No response