Permalink
Browse files

only adding smisk to Server resonse header entity if it's already set…

… by the host server (by looking at env[SERVER_SOFTWARE])
  • Loading branch information...
1 parent 0c15072 commit 29e3ea22884e940864f74eded7e9b94746d95e17 @rsms committed Aug 30, 2009
Showing with 1 addition and 10 deletions.
  1. +1 −10 src/Response.c
View
@@ -221,19 +221,10 @@ PyObject *smisk_Response_begin(smisk_Response* self) {
}
// Add smisk to server tag
- // xxx todo: make configurable. But how? Adding it to smisk.core module won't be
- // good since we have no way of accessing the value directly (if we put
- // it as a property of the module, we have to do expensive python lookups)
- // So maybe adding it to Application like Application.current? No, that
- // will cause the same problem as described earlier, since we have no way
- // of reading the value without the expensive lookup.
char *server_software = FCGX_GetParam("SERVER_SOFTWARE", smisk_Application_current->request->envp);
- if (server_software) {
+ if (server_software && strlen(server_software)) {
FCGX_FPrintF(self->out->stream, "Server: %s smisk/%s\r\n", server_software, SMISK_VERSION);
}
- else {
- FCGX_FPrintF(self->out->stream, "Server: smisk/%s\r\n", SMISK_VERSION);
- }
// Headers?
if (self->headers && PyList_Check(self->headers) && (num_headers = PyList_GET_SIZE(self->headers))) {

0 comments on commit 29e3ea2

Please sign in to comment.