Skip to content

Handle incorrect browser-supplied mime type #790

@wwilsman

Description

@wwilsman

Misconfigured servers may sometimes forget to include a Content-Type header, which is where a response's mime type is inferred from. It appears, however, that while the browser renders responses with missing content-types fine due to mime type sniffing, the response.mimeType CDP property does not convey that inferred mime type. Instead, the property defaults to text/plain, which is usually incorrect.

In asset discovery, we should add logic around text/plain response mime types that ensure there is a Content-Type header. If there is no header, and the response URL contains an extension, we should infer the mime type ourselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions