mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 12:22:17 +01:00
improving tests coverage of http package + using a real word request when testing enforceContentTypeHandler
This commit is contained in:
@@ -20,6 +20,13 @@ func TestCheckAuthorizedContentType(t *testing.T) {
|
||||
if err := CheckAuthorizedContentType(req.Header); err != nil {
|
||||
t.Error("Function should have been able to retrieve an authorized content type from request's header")
|
||||
}
|
||||
|
||||
// case 3: uses a request with a composed content type entry in its header.
|
||||
req.Header.Set("Content-Type", "multipart/form-data; boundary=—-WebKitFormBoundary7MA4YWxkTrZu0gW")
|
||||
if err := CheckAuthorizedContentType(req.Header); err != nil {
|
||||
t.Error("Function should have been able to retrieve an authorized content type from request's header")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestNotAuthorizedContentTypeError(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user