}
}
- if (priv->http_version == SOUP_HTTP_1_0) {
- g_string_append_printf (header, "%s %s HTTP/1.0\r\n",
- req->method, uri_string);
- } else {
- g_string_append_printf (header, "%s %s HTTP/1.1\r\n",
- req->method, uri_string);
- if (!soup_message_headers_get_one (req->request_headers, "Host")) {
- if (soup_uri_uses_default_port (uri)) {
- g_string_append_printf (header, "Host: %s\r\n",
- uri_host);
- } else {
- g_string_append_printf (header, "Host: %s:%d\r\n",
- uri_host, uri->port);
- }
+ g_string_append_printf (header, "%s %s HTTP/1.%d\r\n",
+ req->method, uri_string,
+ (priv->http_version == SOUP_HTTP_1_0) ? 0 : 1);
+
+ if (!soup_message_headers_get_one (req->request_headers, "Host")) {
+ if (soup_uri_uses_default_port (uri)) {
+ g_string_append_printf (header, "Host: %s\r\n",
+ uri_host);
+ } else {
+ g_string_append_printf (header, "Host: %s:%d\r\n",
+ uri_host, uri->port);
}
}
g_free (uri_string);