itsjunetime / smserver

An app to allow Jailbroken iPhones to send texts & attachments from their browser
GNU General Public License v3.0
158 stars 27 forks source link

Some problems with /send parameters encoding #54

Closed ikey-ru closed 3 years ago

ikey-ru commented 4 years ago

Hi! As described in HTML standard, when we are passing values as post content-value pairs we should use following approach:

application/x-www-form-urlencoded
This is the default content type. Forms submitted with this content type must be encoded as follows:

However, SMS server expects POST data in RFC3986 format (space replaced by %20 and some other differences).

Possible solutions:

  1. Change POST parameters encoding to RFC1738, as it should be.
  2. Clearly define at API.md at /send section that POST parameters should be encoded in RFC3986 format (not the best solution).
itsjunetime commented 3 years ago

Thank you for bringing this to my attention — to be completely honest, I wasn't aware that there were specific formats for post data formatting, so I'm glad you brought this up. It seems that RFC1738 is the expected format, so I'll try to rewrite the sections of my code that send to and handle requests through the /send subdirectory. However, since this will probably require a good amount of time, I can't guarantee when it'll be done. I'll update this task as I work through it or run into any issues with this format.

itsjunetime commented 3 years ago

So recently, when I got time to check out this issue more, I realized that (if I'm not mistaken), all the HTML forms in the web interface are encoded as multitype/form-data (as you can see in lines 1290 and 1302 of src/SMServer/html/chats.html). Due to this, these forms need not conform to RFC1738, but rather to RFC2045 (which I'm fairly certain they already correctly conform to), so I need not change the API at all to remedy this. If you think this is not the case or that I am mistaken about something, please let me know. Otherwise, feel free to close this issue.

itsjunetime commented 3 years ago

This issue has been stale for a while, and the issue is resolved to the best of my knowledge. Closing.