#1 2019-08-26 14:34:21

Edtech
Member
Registered: 2019-07-04
Posts: 7

How to add global HTTP headers (like HSTS) to a REST server?

Hi!

I would add some HTTP headers to my REST server. I found how to add for each API but not to all the API.

For example, I would add the Strict-Transport-Security (HSTS) or Access-Control-Expose-Headers header.

Last edited by Edtech (2019-08-26 14:35:20)

Offline

#2 2019-08-26 16:14:06

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: How to add global HTTP headers (like HSTS) to a REST server?

We usually adds it on the reverse proxy level (nginx add_header directive)

Offline

#3 2019-08-26 17:45:53

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: How to add global HTTP headers (like HSTS) to a REST server?

@Edtech or in case if you don't want to use reverse proxy, your can set .StrictSSL property of mORMotBP HTTP server to
strictSSLOn
strictSSLIncludeSubDomains

Offline

#4 2019-08-27 07:05:21

Edtech
Member
Registered: 2019-07-04
Posts: 7

Re: How to add global HTTP headers (like HSTS) to a REST server?

Ok for HSTS, but it's not natively in Synopse (I use TSQLRestServerDB). And if I want customize the other headers ?

Offline

Board footer

Powered by FluxBB