• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Issue when passing URL as parameter

General Discussion
3
3
226
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    Caio Kenup
    last edited by Mar 23, 2022, 11:55 AM

    I have the very simple trigger that runs

    curl [params]
    

    So I can make GET requests to a local address remotely via the triggerCMD API. (If you think this is a work around using localtunnel or ngrok, it is exactly that)

    My triggerCMD API request looks like this

    https://www.triggercmd.com/api/run/triggerSave?computer=<MY_COMPUTER>&trigger=curl&token=<MY-TOKEN>&params="http://localhost:4040/webhook/id?par1=1&par2=b&par3=temp"

    The request only passes the first argument (par1 = 1), making me think the "&" character is improperly interpreted, despite being between quotes.

    The curl command runs correctly through the terminal

    curl "http://localhost:4040/webhook/id?par1=1&par2=b&par3=temp"
    

    passing all three arguments, again adding weight to the possibility that the API call is doing something to URL when passed as parameter.

    Any insight on how I could get this to work would be greatly appreciated!

    R F 2 Replies Last reply Mar 23, 2022, 9:16 PM Reply Quote 0
    • R
      Russ @Caio Kenup
      last edited by Mar 23, 2022, 9:16 PM

      @caio-kenup, I'll mention this setting in your profile, but you may have already found it:

      f4d4760b-e767-4f47-9922-3d08d5143092-image.png

      I blocked those characters by default because they could be used to run arbitrary commands if parameters are enabled.

      A safer way to do what you're trying to do would be to use a script that takes a series of parameters like this:

      Linux/Mac bash script:

      set -x
      curl "http://localhost:4040/webhook/id?par1=$1&par2=$2&par3=$3"
      

      Make it executable with chmod +x ./script.sh
      Test it with: ./script.bat a b c

      Windows script:

      curl "http://localhost:4040/webhook/id?par1=$1&par2=$2&par3=$3"
      

      Test it with: script.bat a b c

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • F
        Felipe Fanchini @Caio Kenup
        last edited by Xander Jan 7, 2025, 4:36 PM Jan 5, 2025, 10:33 PM

        @Caio-Kenup I solved this problem including ^ just before &. So, as an example, I changed

        start www.youtube.com/watch?v=dQw4w9WgXcQ&autoplay=1
        

        to

        start www.youtube.com/watch?v=dQw4w9WgXcQ^&autoplay=1
        

        I believe that it will works to everybody that has a URL with character "&"

        1 Reply Last reply Reply Quote 0
        • First post
          Last post