Skip to content
Advertisement

HttpURLConnection getting wrong response

Well, my php file includes simple code <?php echo "hello there" ?> Whenever I try read the file using HttpURLConnection.getInputStream(); it returns

<html>

<body>
    <script type="text/javascript" src="/aes.js"></script>
    <script>
        function toNumbers(d) {
            var e = [];
            d.replace(/(..)/g, function(d) {
                e.push(parseInt(d, 16))
            });
            return e
        }

        function toHex() {
            for (var d = [], d = 1 == arguments.length && arguments[0].constructor == Array ? arguments[0] : arguments, e = "", f = 0; f < d.length; f++) e += (16 > d[f] ? "0" : "") + d[f].toString(16);
            return e.toLowerCase()
        }
        var a = toNumbers("f655ba9d09a112d4968c63579db590b4"),
            b = toNumbers("98344c2eee86c3994890592585b49f80"),
            c = toNumbers("b1fd294057e960f23314aeedeca32e65");
        document.cookie = "__test=" + toHex(slowAES.decrypt(c, 2, a, b)) + "; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";
        location.href = "http://classreminder.rf.gd/test.php?i=1";
    </script>
    <noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript>
</body>

</html>

All I want is to just read the raw file.. only “hello there” .. not anything else.. how to do that ?

Advertisement

Answer

The question is old and has been solved long ago. But here is something for people who is facing same issue: Found out that my HttpURLConnection and my php file both was correct. But the server was running a browser check before executing any file. Thus I was unable to reach the php file endpoint. I simply changed the hosting and it solved my issue.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement