Disabling HTTP "Server" response header

525 views
Skip to first unread message

Silvano Maffeis

unread,
Jul 20, 2016, 10:39:28 AM7/20/16
to OPS4J
Hi

Is it possible to configure the org.eclipse.jetty.server.HttpConfiguration "sendServerVersion" property via PAX-WEB?
I would like to disable the sending of the "Server" HTTP response header.

Or is there another way to achieve this?

Thanks and regards,
Silvano

Achim Nierbeck

unread,
Jul 20, 2016, 3:47:10 PM7/20/16
to op...@googlegroups.com
Hi Silvano, 

via a configuration I doubt right now. But if you can disable this by means of  a jetty.xml or a jetty-web.xml in a war file, then it should be possible. 
If that doesn't work we need to add a flag for that. Though at that point we need to make sure it'll work for all servers: 
Jetty, Tomcat and Undertow. 

regards, Achim 


--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Silvano Maffeis

unread,
Jul 21, 2016, 4:24:57 AM7/21/16
to op...@googlegroups.com
Hi Achim

Thanks for your response. Actually I spent quite some time with setting up a jetty.xml but the problem is that if I define an org.eclipse.jetty.server.ServerConnector in jetty.xml on port 8080, I'll receive a port already in use error on startup, since pax-web will create another ServerConnector programmatically in JettyServerImpl (pax-web). Also on port 8080 (org.osgi.service.http).

I also tried setting -Dorg.osgi.service.http.enabled=false assuming that JettyServerImpl would then not create any ServerConnector, but then the ServerConnector I declared in jetty.xml seems like its being initialized, and then closed again by class ServerControllerImpl:

                                        // remove maybe already configured connectors through
// jetty.xml, the config-property/config-admin service is
// master configuration

I also looked at ServerControllerImpl.match() and tried to set up the "name" property of my connector defined in jetty.xml, expecting that in this case the ServerController would recognize my connector and not close it. But also here I had no luck. That's where I decided to post to this group :-)

Silvano

You received this message because you are subscribed to a topic in the Google Groups "OPS4J" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ops4j/s1df4gwFtw4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ops4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Silvano Maffeis, Dr. oec publ.
Im Kehl 6, 5400 Baden

Oliver Lietz

unread,
Jul 21, 2016, 7:16:42 AM7/21/16
to op...@googlegroups.com
On Wednesday 20 July 2016 07:39:28 Silvano Maffeis wrote:
> Hi

Hi Silvano,

> Is it possible to configure the org.eclipse.jetty.server.HttpConfiguration
> "sendServerVersion" property via PAX-WEB?
> I would like to disable the sending of the "Server" HTTP response header.
>
> Or is there another way to achieve this?

you can unset any header with a Servlet Filter.

Regards,
O.

> Thanks and regards,
> Silvano

Reply all
Reply to author
Forward
0 new messages