[TIMOB-24777] iOS: HttpRequests escape URLs with # symbols in them
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2017-06-06T13:49:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Shuo Liang |
Assignee | Unknown |
Created | 2017-06-06T02:06:59.000+0000 |
Updated | 2018-08-06T17:52:07.000+0000 |
Description
Reproduce:
1. Run the attached codes in a Alloy project.
2. Click those two buttons.
3. Check the output.
Problem:
The part of URL after # does not get included in the senting URL. The output always like
Received text: {"args":{},"headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate","Accept-Language":"en-us","Connection":"close","Host":"httpbin.org","User-Agent":"Appcelerator Titanium/6.1.0 (iPhone/10.3; iOS; en_US;)","X-Requested-With":"XMLHttpRequest","X-Titanium-Id":"c2bbbb9f-5bc7-4761-9111-bca83e6b6d8e"},"method":"GET","origin":"114.253.205.80","url":"http://httpbin.org/anything"}
Attachments
File | Date | Size |
---|---|---|
index.js | 2017-06-06T02:06:54.000+0000 | 1286 |
index.xml | 2017-06-06T02:06:44.000+0000 | 191 |
The test-case looks invalid for me. What would be expected? That the payload parameter
url
include the#allTheThings
suffix? If so, the test-case is not correct, because opening [the URL](http://httpbin.org/anything#allTheThings) in the browser gives the same result as the app. I created [another test-case](http://hans-knoechel.de/TIMOB-24777.php#allTheThings) just to ensure, and it also does not print the suffix (both from browser and app). [Here](https://stackoverflow.com/a/940923/5537752) is the reason why: {quote} The main problem is that the browser won't even send a request with a fragment part. The fragment part is resolved right there in the browser. So it's reachable through JavaScript. Anyway, you could parse a URL into bits, including the fragment part, using parse_url(), but it's obviously not your case. {quote} This is not a Titanium issue, so either the backend should be fixed to use proper get-parameters like?option=allTheThings
or preprocess the#
suffix with Javascript (what it's usually used for).Closing as "not our bug". If you disagree, please reopen.