Waboodoo / HTTP-Shortcuts

Android app to create home screen shortcuts that trigger arbitrary HTTP requests
https://http-shortcuts.rmy.ch
MIT License
1.17k stars 113 forks source link

[BUG] GET parameters seems to be ignored #219

Closed Offerel closed 3 years ago

Offerel commented 3 years ago

Steps To Reproduce

  1. Create a new shortcut
  2. Use GET as method
  3. Enter URL as "https://your.domain.com/?link={url}&var1=android&var2=false"
  4. {url} is a variable, filled with some url, followed by some additional variables

Expected behavior At the server, I try to parse the parameters with PHP. I expect the value "android" in $_GET['var1']

Actual behavior $_GET['var1'] seems to be empty. However $_GET['link'] has the correct value.

Context (please complete the following information):

Maybe I have something configured the wrong way. For my understanding, i add the GET parameters only by inserting them in the URL for the GET Shortcut.

Waboodoo commented 3 years ago

If you want to place a URL into a query string of another URL, you'll need to URL-encode it, as otherwise the 2 URLs will clash and parsing it will become ambiguous.

You can enable URL-encoding by ticking the "URL encode" checkbox when editing the variable:

Screenshot from 2021-04-01 12-19-15

Offerel commented 3 years ago

Got it. You are right. UrlEncode it seems to work as expected.

BTW: im using your app for example with my Bookmark tool: https://github.com/Offerel/SyncMarks-Webapp/blob/d96a4d03b3b411ed4ddc3e1e4df79ecf4af7de5d/index.php#L719