OSDN Git Service

Merge branch 'branch_0.12.0' into branch_0.13.0-svn
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 5 Apr 2009 08:40:53 +0000 (08:40 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 5 Apr 2009 08:40:53 +0000 (08:40 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_13_0@4694 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/chxj_serf.c
src/mod_chxj.c

index ac3a166..3512601 100644 (file)
@@ -331,7 +331,10 @@ default_chxj_serf_get(request_rec *r, apr_pool_t *ppool, const char *url_path, i
   handler_ctx.host = url.hostinfo;
   handler_ctx.method = "GET";
   handler_ctx.path = url.path;
-  handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, "User-Agent");
+  handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
+  if (!handler_ctx.user_agent) {
+    handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, HTTP_USER_AGENT);
+  }
   handler_ctx.post_data = NULL;
   handler_ctx.post_data_len = 0;
 
@@ -435,7 +438,10 @@ default_chxj_serf_post(request_rec *r, apr_pool_t *ppool, const char *url_path,
   handler_ctx.host = url.hostinfo;
   handler_ctx.method = "POST";
   handler_ctx.path = url.path;
-  handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, "User-Agent");
+  handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
+  if (! handler_ctx.user_agent) {
+    handler_ctx.user_agent = (char *)apr_table_get(r->headers_in, HTTP_USER_AGENT);
+  }
   handler_ctx.post_data = post_data;
   handler_ctx.post_data_len = post_data_len;
 
index 128977e..99d2c64 100644 (file)
@@ -1347,7 +1347,10 @@ chxj_input_handler(request_rec *r)
   apr_pool_create(&pool, r->pool);
 
   dconf      = chxj_get_module_config(r->per_dir_config, &chxj_module);
-  user_agent = (char*)apr_table_get(r->headers_in, "User-Agent");
+  user_agent = (char*)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
+  if (!user_agent) {
+    user_agent = (char*)apr_table_get(r->headers_in, HTTP_USER_AGENT);
+  }
   spec       = chxj_specified_device(r, user_agent);
   entryp     = chxj_apply_convrule(r, dconf->convrules);