Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add microsoft vendor-specific content types to be excluded by default #1213

Merged
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 @@ -23,7 +23,18 @@ public static <T extends HttpMessage> BodyReplacer<T> defaultValue() {
@API(status = MAINTAINED)
public static <T extends HttpMessage> BodyReplacer<T> binary() {
final Predicate<T> contentTypes = contentType(
"application/octet-stream", "application/pdf", "audio/*", "image/*", "video/*");
"application/octet-stream",
"application/pdf", // Adobe Portable Document Format (PDF)
"application/vnd.ms-excel", // Microsoft Excel
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", // Microsoft Excel (OpenXML)
"application/msword", // Microsoft Word
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", // Microsoft Word (OpenXML)
"application/vnd.ms-powerpoint", // Microsoft PowerPoint
"application/vnd.openxmlformats-officedocument.presentationml.presentation", // Microsoft PowerPoint (OpenXML)
"audio/*", // Audio
"image/*", // Image
"video/*" // Video
);
return replaceBody(contentTypes, "<binary>");
}

Expand All @@ -38,7 +49,8 @@ public static <T extends HttpMessage> BodyReplacer<T> stream() {
"application/json-seq", // https://tools.ietf.org/html/rfc7464
"application/x-json-stream", // https://en.wikipedia.org/wiki/JSON_Streaming#Line_delimited_JSON
"application/stream+json", // https://tools.ietf.org/html/draft-snell-activity-streams-type-01
"text/event-stream" // https://tools.ietf.org/html/rfc6202
"text/event-stream", // https://tools.ietf.org/html/rfc6202
"application/x-ndjson" // https://ndjson.org
);
return replaceBody(contentTypes, "<stream>");
}
Expand Down