Skip to content

Commit

Permalink
Fix mime type for authority chain rest API
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarco76 committed Oct 31, 2024
1 parent 830de10 commit a59b015
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public void getChain(HttpServletRequest request, HttpServletResponse response) t
out.println(cert);
return;
}
if (accept.equals(MediaType.ANYTYPE) || accept.contains(MediaType.APPLICATION_PKIX_CERT)) {
response.setContentType(MediaType.APPLICATION_PKIX_CERT);
if (accept.equals(MediaType.ANYTYPE) || accept.contains(MediaType.APPLICATION_PKCS7)) {
response.setContentType(MediaType.APPLICATION_PKCS7);
byte[] cert = authority.getBinaryChain(aid);
OutputStream out = response.getOutputStream();
out.write(cert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class MediaType {

public static final String APPLICATION_PKIX_CERT = "application/pkix-cert";

public static final String APPLICATION_PKCS7 = "application/pkcs7-mime";

public static final String APPLICATION_X_PEM_FILE = "application/x-pem-file";

public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";
Expand Down

0 comments on commit a59b015

Please sign in to comment.