Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    HTML in HTTP POST action form parameter?

    Scheduled Pinned Locked Moved Support
    httpbuildmaster
    4 Posts 1 Posters 18 Views
    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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      How do I properly encode or escape HTML for a parameter value of an HTTP 'Post to URL' deployment action?

      Product: BuildMaster
      Version: 4.5.7

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        1. Don't quote the entire parameter value, e.g. by surrounding it with double or single quote characters.
        2. URL-encode (most) of the parameter value.
        3. But don't URL-encode any BuildMaster variable expansions in the value.
        4. Escape percent sign characters for the URL-encode values, i.e. by doubling each percent sign, but don't escape old-school-style BuildMaster variable expansions.

        [2] might be easiest if you breakup your parameter value into chunks, one for each contiguous block of text or BuildMaster variable expansion. Then once you've properly encoded and escaped each chunk, combine them as a single line or block of text.

        Here's an example of the action Data field for sending a HipChat notification:

        color=red&message=BuildMaster+failed+to+deploy+version+%%3ca+href%%3d%%22http%%3a%%2f%%2fmy-buildmaster-server%%3a81%%2fapplications%%2f$ApplicationId%%2fbuilds%%2fbuild%%3freleaseNumber%%3d$ReleaseNumber%%26buildNumber%%3d$BuildNumber%%22%%3e%RELNO%.%BLDNO%%%3c%%2fa%%3e+of+the+$ApplicationName+app+to+the+$EnvironmentName+environment.&notify=true

        Here's the un-encoded and unescaped version, with each form parameter on a separate line:

        color=red
        message=BuildMaster failed to deploy version <a href="http://my-buildmaster-server:81/applications/$ApplicationId/builds/build?releaseNumber=$ReleaseNumber&buildNumber=$BuildNumber">%RELNO%.%BLDNO%</a> of the $ApplicationName app to the $EnvironmentName environment.
        notify=true

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Thanks for the feedback and analysis. We'll try to get this to work more intuitively in an updated version. I'm tentatively logging this issue for resolution in 4.6.2, but we'll keep you informed if something changes.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            This action has been updated in 4.6.4, which is now available. We've added a more friendly editor for form data and some better documentation in the action. The UI will probably still be refined in a future release, but it should be more intuitive now.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation