Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24777] iOS: HttpRequests escape URLs with # symbols in them

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-06-06T13:49:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShuo Liang
AssigneeUnknown
Created2017-06-06T02:06:59.000+0000
Updated2018-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

FileDateSize
index.js2017-06-06T02:06:54.000+00001286
index.xml2017-06-06T02:06:44.000+0000191

Comments

  1. Hans Knöchel 2017-06-06

    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).
  2. Eric Merriman 2018-08-06

    Closing as "not our bug". If you disagree, please reopen.

JSON Source