Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6560

JsonOutput does not escape URL (windows path)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.2, 2.3.0-beta-1
    • Component/s: JSON
    • Labels:
      None

      Description

      URL may contains '\' char and in this case url also must escaped.

      To reproduce bug:

      assert JsonOutput.toJson(new URL('file', '', 'C:\\this\\is\\windows\\path')) == '"file:C:\\\\this\\\\is\\\\windows\\\\path"'
      
      Assertion failed: 
      
      assert JsonOutput.toJson(new URL('file', '', 'C:\\this\\is\\windows\\path')) == '"file:C:\\\\this\\\\is\\\\windows\\\\path"'
                        |      |                                                   |
                        |      file:C:\this\is\windows\path                        false
                        "file:C:\this\is\windows\path"
      

        Attachments

          Activity

            People

            • Assignee:
              Guillaume Guillaume Delcroix
              Reporter:
              bura Andrey Bloschetsov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: