Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,10 @@ protected void captureResponse(HttpResponse httpResponse) {

protected void captureResponseMimeType(HttpResponse httpResponse) {
String contentType = HttpHeaders.getHeader(httpResponse, HttpHeaders.Names.CONTENT_TYPE);
harEntry.getResponse().getContent().setMimeType(contentType);
// don't set the mimeType to null, since mimeType is a required field
if (contentType != null) {
harEntry.getResponse().getContent().setMimeType(contentType);
}
}

protected void captureResponseCookies(HttpResponse httpResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
public class HarContent {
private volatile long size;
private volatile Long compression;

// mimeType is required; though it shouldn't be set to null, if it is, it still needs to be included to comply with the HAR spec
@JsonInclude(JsonInclude.Include.ALWAYS)
private volatile String mimeType = "";

private volatile String text;
private volatile String encoding;
private volatile String comment = "";
Expand Down