OSDN Git Service

* Fixed Bug.
authorAtsushi Konno <konn@users.sourceforge.jp>
Sun, 5 Apr 2009 08:36:14 +0000 (17:36 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Sun, 5 Apr 2009 08:36:14 +0000 (17:36 +0900)
    - http://sourceforge.jp/ticket/browse.php?group_id=1608&tid=15968

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 9a808c1..fb096eb 100644 (file)
@@ -1355,7 +1355,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);