B4J Question [Server] How to set content-type in the response for specific file types?

avalle

Active Member
Licensed User
Longtime User
Hi all
my jServer application serves some static content. For HTML files it automatically appends "Content-Type: text/html" to responses.
I also have different file types and I need to set the specific content-type for them.

How can this be done?

Thanks
Andrea
 

avalle

Active Member
Licensed User
Longtime User
I'm handling CRL files. The client expects to get content-type application/pkix-crl as per RFC 5280
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
Thanks Erel. I'm going to check this.
Is it right to apply it during the srvr initialization phase?
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
This was indeed the case. It works, thanks a lot!

B4X:
< HTTP/1.1 200 OK
< Date: Tue, 09 Mar 2021 14:40:00 GMT
< Last-Modified: Mon, 15 Feb 2021 15:16:03 GMT
< Content-Type: application/pkix-crl
< Accept-Ranges: bytes
< Content-Length: 1014
< Server: Jetty(9.4.z-SNAPSHOT)
 
Upvote 0
Top