Author: dumindu
Date: Thu Dec 6 01:07:13 2007
New Revision: 10607
Log:
Added prefixes to http headers.
Modified:
trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
trunk/solutions/identity/modules/mod-cspace/mod_cspace.h
trunk/solutions/identity/modules/mod-cspace/process_request.c
trunk/solutions/identity/modules/mod-cspace/process_request.h
Modified: trunk/solutions/identity/modules/mod-cspace/mod_cspace.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/mod_cspace.c (original)
+++ trunk/solutions/identity/modules/mod-cspace/mod_cspace.c Thu Dec 6
01:07:13 2007
@@ -181,13 +181,25 @@
{
apr_table_t *t = (apr_table_t *)table;
-#ifndef DONT_INCLUDE_CS_PFX_IN_HEADERS
- key = apr_pstrcat(pool, CARDSPACE_HEADER_PFX, key, NULL);
+#ifdef CSPACE_DEBUG
+ printf("Header %s/%s:%s\n", uri, key, val);
#endif
- printf("Header %s/%s:%s\n", uri, key, val);
-
- apr_table_set(t, apr_pstrcat(pool, uri, "/", key, NULL), val);
+#ifndef DONT_INCLUDE_CS_PFX_IN_HEADERS
+ if (uri) {
+ apr_table_set(t, apr_pstrcat(pool, CARDSPACE_HEADER_PFX, uri, "/",
+ key, NULL),val);
+ } else {
+ apr_table_set(t, apr_pstrcat(pool, CARDSPACE_HEADER_PFX, key, NULL),
+ val);
+ }
+#else /* DONT_INCLUDE_CS_PFX_IN_HEADERS */
+ if (uri) {
+ apr_table_set(t, apr_pstrcat(pool, uri, "/", key, NULL), val);
+ } else {
+ apr_table_set(t, apr_pstrcat(pool, key, NULL), val);
+ }
+#endif /* DONT_INCLUDE_CS_PFX_IN_HEADERS */
/*process_context_extract info dups for us*/
Modified: trunk/solutions/identity/modules/mod-cspace/mod_cspace.h
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/mod_cspace.h (original)
+++ trunk/solutions/identity/modules/mod-cspace/mod_cspace.h Thu Dec 6
01:07:13 2007
@@ -6,7 +6,7 @@
#include "http_config.h"
#include "session.h"
-#define DONT_INCLUDE_CS_PFX_IN_HEADERS
+/*#define DONT_INCLUDE_CS_PFX_IN_HEADERS*/
/*for apache2.0*/
#ifndef ap_http_scheme
Modified: trunk/solutions/identity/modules/mod-cspace/process_request.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request.c
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request.c Thu Dec
6 01:07:13 2007
@@ -75,7 +75,6 @@
static int register_id(xmlDoc *doc, xmlNodePtr node, const xmlChar* idName);
static int extract_info(process_context_t *ctx, xmlDoc *doc);
-/*TODO: remove the last two params*/
int cspace_process_request(process_context_t *ctx, const char *req)
{
int res = FAIL;
@@ -112,18 +111,14 @@
/*add the "cardspace_state" header*/
if (res) {
- (*ctx->set_header_fn)(cspace_strdup(CARDSPACE_DEFAULT_NS_URI,
- ctx->allocator),
- cspace_strdup(CARDSPACE_HEADER_STATE,
+ (*ctx->set_header_fn)(NULL, cspace_strdup(CARDSPACE_HEADER_STATE,
ctx->allocator),
cspace_strdup(CARDSPACE_STATE_SUCCESS,
ctx->allocator),
ctx->header_container,
ctx->set_header_cb_ctx);
} else {
- (*ctx->set_header_fn)(cspace_strdup(CARDSPACE_DEFAULT_NS_URI,
- ctx->allocator),
- cspace_strdup(CARDSPACE_HEADER_STATE,
+ (*ctx->set_header_fn)(NULL, cspace_strdup(CARDSPACE_HEADER_STATE,
ctx->allocator),
cspace_strdup(CARDSPACE_STATE_FAIL,
ctx->allocator),
Modified: trunk/solutions/identity/modules/mod-cspace/process_request.h
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request.h
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request.h Thu Dec
6 01:07:13 2007
@@ -10,8 +10,7 @@
#define SUCC !(FAIL)
#endif
-#define CARDSPACE_DEFAULT_NS_URI "urn:default"
-#define CARDSPACE_HEADER_STATE "state"
+#define CARDSPACE_HEADER_STATE "auth_state"
#define CARDSPACE_STATE_SUCCESS "success"
#define CARDSPACE_STATE_FAIL "failure"
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev