Skip to content

Quotes are not escaped in JSON message #15

@mbalbus

Description

@mbalbus

Option argstring breaks JSON when some arguments contain quotes.
Please add escaping for placeholders.

Example rundek job that breaks JSON:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  group: ZZZ
  loglevel: INFO
  name: notification-test
  nodeFilterEditable: true
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      successOnEmptyNodeFilter: false
      threadcount: '1'
    filter: ZZZ
  nodesSelectedByDefault: true
  notification:
    onfailure:
      plugin:
        configuration:
          authentication: None
          body: |
            {
              "name": "Args:",
              "value": "${execution.argstring}"
            }
          contentType: application/json
          method: POST
          remoteUrl: http://SOME_SERVER
          timeout: '30000'
        type: HttpNotification
  notifyAvgDurationThreshold: null
  options:
    - name: returnCode
      required: true
      value: 1
    - name: text
      value: '''value in quotes "ZZZ" '''
  plugins:
    ExecutionLifecycle: {}
  scheduleEnabled: true
  schedules: []
  sequence:
    commands:
      - exec: exit ${option.returnCode}
    keepgoing: false
    strategy: node-first

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions