- const char *configFile;
-@@ -1192,6 +1193,7 @@
- addEnv("SERVER", "PROTOCOL", "HTTP/1.0");
- addEnv("GATEWAY_INTERFACE", "", "CGI/1.1");
- addEnv("REMOTE", "ADDR", config->rmt_ip_str);
-+ addEnv("HTTP","USER_AGENT", config->user_agent);
- #ifdef CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
- addEnvPort("REMOTE");
+@@ -1066,6 +1067,7 @@
+ if (cp) *cp = '\0'; /* delete :PORT */
+ setenv1("REMOTE_ADDR", p);
+ }
++ setenv1("HTTP_USER_AGENT", config->user_agent);
+ #if ENABLE_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
+ setenv_long("REMOTE_PORT", config->port);