Browse Source

[Minor] Do not add User-Agent if it exists

tags/2.0
Vsevolod Stakhov 4 years ago
parent
commit
8c0dfd2867
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      src/libutil/http_connection.c

+ 9
- 2
src/libutil/http_connection.c View File

@@ -1965,8 +1965,15 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn
}

if (priv->ctx->config.user_agent && conn->type == RSPAMD_HTTP_CLIENT) {
rspamd_http_message_add_header (msg, "User-Agent",
priv->ctx->config.user_agent);
struct rspamd_http_header *found = NULL;

HASH_FIND (hh, msg->headers, "User-Agent",
sizeof ("User-Agent") - 1, found);

if (!found) {
rspamd_http_message_add_header (msg, "User-Agent",
priv->ctx->config.user_agent);
}
}

if (encrypted) {

Loading…
Cancel
Save