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

JsonOutput does not escape URL (windows path)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.2, 2.3.0-beta-1
    • JSON
    • 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

            guillaume Guillaume Sauthier
            bura Andrey Bloschetsov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: