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?
-
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
-
- Don't quote the entire parameter value, e.g. by surrounding it with double or single quote characters.
- URL-encode (most) of the parameter value.
- But don't URL-encode any BuildMaster variable expansions in the value.
- 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.¬ify=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
-
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.
-
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.