How to use String.substring?
GET /ilyen_nincs HTTP/1.1\n is 26 characters long so string indices are from 0 to 25. Since, your second argument in substring(0, firstEOLAt); exceeds the end index of the string, you are running into unexpected behavior as per the documentation and getting an empty string.


  Caution: make sure your index values are within the String's length or you'll get unpredictable results. This kind of error can be particularly hard to find with the second instance of substring() if the starting position is less than the String's length, but the ending position isn't.