[ad_1]
I’m coding a easy net server in C, the server makes use of TLS for HTTPS (if that helps), however for some motive, once I check the browser on ios gadgets, the ios gadgets don’t ship a physique throughout the HTTP message.
They sometimes will ship a physique, however often don’t. They ship the HTTP headers, with the Content material-Size: header, however there’s by no means a physique within the message. This situation solely appears to occur on ios gadgets, however not on Home windows or Linux gadgets.
Right here is among the uncommon profitable occasions an ios system despatched a correct message:
POST /operation_login HTTP/1.1
Host: 192.168.1.187:9999
Content material-Kind: software/x-www-form-urlencoded
Origin: https://192.168.1.187:9999
Settle for-Encoding: gzip, deflate, br
Connection: keep-alive
Settle for: textual content/html,software/xhtml+xml,software/xml;q=0.9,*/*;q=0.8
Person-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Cell/15E148 Safari/604.1
Referer: https://192.168.1.187:1024/public/statics/login.html
Content material-Size: 29
Settle for-Language: en-US,en;q=0.9
username=aaa&password=1234567
Often the message appears like this. (no physique):
POST /operation_login HTTP/1.1
Host: 192.168.1.187:9999
Content material-Kind: software/x-www-form-urlencoded
Origin: https://192.168.1.187:9999
Settle for-Encoding: gzip, deflate, br
Connection: keep-alive
Settle for: textual content/html,software/xhtml+xml,software/xml;q=0.9,*/*;q=0.8
Person-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Cell/15E148 Safari/604.1
Referer: https://192.168.1.187:1024/public/statics/login.html
Content material-Size: 29
Settle for-Language: en-US,en;q=0.9
The C code for the server is just too lengthy to share right here, however right here is a few information on the server.
In the event you actually care sufficient to spend 7 minutes studying the supply code to assist me, here’s a hyperlink to its public Github repository. (https://github.com/troyahamilton/check/tree/major)
- it’s utilizing a self signed SSL certificates (possibly apple has one thing in opposition to this)
- it calls SSL_read() a single time earlier than parsing (if known as twice, it hangs)
- it doesn’t cache any knowledge (that may be exhausting to implement)
Does anyone know of any details about ios browsers not sending a physique in a POST message.
I’ve some theories on why ios browsers are doing this, however all my makes an attempt to repair them fail. Listed below are a few of them:
- The ios browsers anticipate my little server to cache all knowledge flowing out and in
- The ios browsers need some particular header telling them to not cache knowledge, and to ship the physique of every message in each request, even when it’s the identical as a previous message.
- The ios browsers fail to incorporate the physique inside a message
- The ios browsers have some form of safety factor the place they dont ship the physique of HTTP messages to servers utilizing self signed certificates
[ad_2]
