Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #536 from Kitware/hide-cherrypy-version
Browse files Browse the repository at this point in the history
Hide cherrypy version in Server response header
  • Loading branch information
waxlamp committed Jan 19, 2016
2 parents b4c90e0 + 2d3e260 commit 733900b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -39,6 +39,8 @@ versioning](http://semver.org).
error messages

### Security
- ``Server`` response header now reads "Tangelo" instead of "CherryPy" with a
version string

## [0.9] - 2015-03-03
### Added
Expand Down
4 changes: 4 additions & 0 deletions tangelo/tangelo/server.py
Expand Up @@ -541,6 +541,10 @@ def dirlisting(dirpath, reqpath):
return result

def execute_analysis(self, query_args):
# Hide the identity/version number of the server technology in the
# response headers.
cherrypy.response.headers["Server"] = ""

# Analyze the URL.
analysis = analyze_url(cherrypy.request.path_info)
directive = analysis.directive
Expand Down
10 changes: 10 additions & 0 deletions tests/server-identity.py
@@ -0,0 +1,10 @@
import nose
import requests

import fixture


@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == ""

0 comments on commit 733900b

Please sign in to comment.