Ver Fonte

Add "Accept: application/dns-message" as for RFC 8484 Guidance

The DoH client SHOULD include an HTTP Accept request header field to indicate what type of content can be understood in response.
Irrespective of the value of the Accept request header field, the client MUST be prepared to process "application/dns-message" (as described in Section 6) responses but MAY also process other DNS-related media types it receives.
闲人一枚 há 2 meses atrás
pai
commit
b54703008f
2 ficheiros alterados com 3 adições e 1 exclusões
  1. 2 1
      src/dns_client/client_http3.c
  2. 1 0
      src/dns_client/client_https.c

+ 2 - 1
src/dns_client/client_http3.c

@@ -52,6 +52,7 @@ int _dns_client_send_http3(struct dns_query_struct *query, struct dns_server_inf
 	http_head_add_fields(http_head, ":authority", https_flag->httphost);
 	http_head_add_fields(http_head, "user-agent", "smartdns");
 	http_head_add_fields(http_head, "content-type", "application/dns-message");
+	http_head_add_fields(http_head, "accept", "application/dns-message");
 	http_head_add_fields(http_head, "accept-encoding", "identity");
 	http_head_set_data(http_head, packet, len);
 
@@ -138,4 +139,4 @@ errout:
 
 	return -1;
 }
-#endif
+#endif

+ 1 - 0
src/dns_client/client_https.c

@@ -44,6 +44,7 @@ int _dns_client_send_https(struct dns_server_info *server_info, void *packet, un
 						"Host: %s\r\n"
 						"User-Agent: smartdns\r\n"
 						"Content-Type: application/dns-message\r\n"
+						"Accept: application/dns-message\r\n"	
 						"Content-Length: %d\r\n"
 						"\r\n",
 						https_flag->path, https_flag->httphost, len);