scalasprayspray-can

How to remove spray-can/1.3.3 from response


I use spray.io to serve HTTP requests. In response there is information about spray framework that I would like to remove. So how to remove "Server: spray-can/1.3.3" from the response header in spray?


Solution

  • You can set this via application.conf:

    spray.can {
    
      server {
        # The value of the `Server` header to produce.
        # Set to the empty string to disable rendering of the server header.
        server-header = spray-can/${spray.version}
      }
    }