Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-10991

Don't display error responses containing HTML content

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.4
    • Component/s: Scanner
    • Labels:
    • Edition:
      Community
    • Production Notes:
      None

      Description

      When there is a error code returned by a WS, the scanner tries to parse a JSON message out of it. If no such message is found, it dumps into the logs the entire body of the response.
      This can be a very long and useless HTML content:

      [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project polyforms: Failed to upload report - 502: <!DOCTYPE html>
      [ERROR] <html>
      [ERROR] <head>
      [ERROR] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      [ERROR] <meta http-equiv="X-UA-Compatible" content="IE=edge">
      [ERROR] <meta name="robots" content="index, follow">
      [ERROR] <title>Server Error - Peach</title>
      [ERROR] <link rel="shortcut icon" type="image/ico" href="data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///
      

      (continues, it can be really long...)

      We should either limit the length of this response, or detect that it's HTML content and not display anything at all.

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            duarte.meneses Duarte Meneses
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: