IOS does not send load of POST request

I have coded a python web server to access the control panel you have to fill in the token. This token is sent to the web server, then the web server responds to the control panel.

Everything works fine, from my computer the token works every time - HOWEVER , from an iOS device, it doesn't work 90% of the time> Atog doesn't send most of the time!

HTML:

<!DOCTYPE html>
<html>
    <head>
        <title>Drakon</title>
        <link rel="stylesheet" type="text/css" href="access.css">
    </head>
    <body>

    <div class="login">
        <div class="heading">
            <h2>Gain access</h2>
            <form method="POST">

            <div class="input-group input-group-lg">
                <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                <input name="token" type="password" class="form-control" placeholder="Token">
            </div>

            <button type="submit" class="float">Validate</button>
            </form>
        </div>
    </div>
    </body>
</html>

      

This is the POST request I receive from the iOS device:

POST / HTTP/1.1\r\nHost: 192.168.2.4:8000\r\nReferer: http://192.168.2.4:8000/\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: nl-nl\r\nAccept-Encoding: gzip, deflate\r\nOrigin: http://192.168.2.4:8000\r\nContent-Length: 10\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53\r\n\r\n

      

What should I get, and sometimes get it for some reason:

POST / HTTP/1.1\r\nHost: 192.168.2.4:8000\r\nReferer: http://192.168.2.4:8000/\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: nl-nl\r\nAccept-Encoding: gzip, deflate\r\nOrigin: http://192.168.2.4:8000\r\nContent-Length: 11\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53\r\n\r\ntoken=lucas

      

Difference: the correct (second) has a token = lucas at the end. Why doesn't the iOS device sometimes send this token along with the post request? Am I watching something?

In a bad script, everything fails; the device is not even redirected to the main page as it should after the wrong token.

The request is sent from the Safari browser on the iOS device , not the custom iOS app.

+3


source to share


1 answer


Try adding enctype="multipart/form-data"

to form parameters.



0


source







All Articles