boblemaire / asyncHTTPrequest

asynchronous HTTP for ESP using ESPasyncTCP. Works like XMLHTTPrequest in JS.
GNU General Public License v3.0
64 stars 31 forks source link

HTTP:// in URL is case sensitive, won't accept http:// #5

Closed ramarro123 closed 5 years ago

ramarro123 commented 5 years ago

i am not 100% it's intended but, without documentation it's hard so i dig a bit on code and found

_URL->scheme = new char[8];
strcpy(_URL->scheme, "HTTP://");
if(url.startsWith("HTTP://")) {
   hostBeg += 7; 
}

my url was http:// and it doesn't work... converting it with uppercase make it work apparently. doing a touppercase doesn't seems a good idea, cos parameters get uppercase as well.

boblemaire commented 5 years ago

That's something that's easily done without converting the whole String to uppercase:

if(url.substring(0,7).equalsIgnoreCase("HTTP://")){

Can you send a PR?

ramarro123 commented 5 years ago

probably done :) first PR so not sure if i did it correctly

boblemaire commented 5 years ago

Fixed with PR#6