浏览代码

Merge pull request #804 from wangkx/gh-803

Fix gh-803 User-Agent not set if no LDAP enabled

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父节点
当前提交
2e9b308f67
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 0 3
      esp/bindings/http/platform/httpbinding.cpp
  2. 4 0
      esp/bindings/http/platform/httptransport.cpp

+ 0 - 3
esp/bindings/http/platform/httpbinding.cpp

@@ -450,9 +450,6 @@ void EspHttpBinding::populateRequest(CHttpRequest *request)
 
     ctx->setSecManger(m_secmgr.getLink());
     ctx->setFeatureAuthMap(m_feature_authmap.getLink());
-    StringBuffer useragent;
-    request->getHeader("User-Agent", useragent);
-    ctx->setUseragent(useragent.str());
 
     StringBuffer userid, password,realm,peer;
     ctx->getUserID(userid);

+ 4 - 0
esp/bindings/http/platform/httptransport.cpp

@@ -1517,6 +1517,10 @@ void CHttpRequest::updateContext()
             else
                 m_context->setClientVersion(0.0);
         }
+
+        StringBuffer useragent;
+        getHeader("User-Agent", useragent);
+        m_context->setUseragent(useragent.str());
     }
 }