Ver código fonte

made headers case insensitive

Ariel Manzur 9 anos atrás
pai
commit
3db379376f
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      core/io/http_client.cpp

+ 3 - 2
core/io/http_client.cpp

@@ -307,14 +307,15 @@ Error HTTPClient::poll(){
 					for(int i=0;i<responses.size();i++) {
 
 						String s = responses[i].strip_edges();
+						s = s.to_lower();
 						if (s.length()==0)
 							continue;						
-						if (s.begins_with("Content-Length:")) {
+						if (s.begins_with("content-length:")) {
 							body_size = s.substr(s.find(":")+1,s.length()).strip_edges().to_int();
 							body_left=body_size;
 						}
 
-						if (s.begins_with("Transfer-Encoding:")) {
+						if (s.begins_with("transfer-encoding:")) {
 							String encoding = s.substr(s.find(":")+1,s.length()).strip_edges();
 							//print_line("TRANSFER ENCODING: "+encoding);
 							if (encoding=="chunked") {