{"record":{"id":"b3d18edea2904da3","repo":"discourse/discourse","slug":"url","errorCode":null,"errorMessage":"url","messagePattern":"url","errorType":"validation","errorClass":"Discourse::InvalidParameters","httpStatus":400,"severity":"error","filePath":"lib/file_helper.rb","lineNumber":76,"sourceCode":"  class FakeIO\n    attr_accessor :status\n  end\n\n  def self.download(\n    url,\n    max_file_size:,\n    tmp_file_name:,\n    follow_redirect: false,\n    read_timeout: 5,\n    skip_rate_limit: false,\n    verbose: false,\n    validate_uri: true,\n    retain_on_max_file_size_exceeded: false,\n    include_port_in_host_header: false,\n    extra_headers: {}\n  )\n    url = \"https:\" + url if url.start_with?(\"//\")\n    raise Discourse::InvalidParameters.new(:url) unless url =~ %r{\\Ahttps?://}\n\n    tmp = nil\n\n    fd =\n      FinalDestination.new(\n        url,\n        max_redirects: follow_redirect ? 5 : 0,\n        skip_rate_limit: skip_rate_limit,\n        verbose: verbose,\n        validate_uri: validate_uri,\n        timeout: read_timeout,\n        include_port_in_host_header: include_port_in_host_header,\n        headers: extra_headers,\n      )\n\n    fd.get do |response, chunk, uri|\n      if tmp.nil?\n        # error handling","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/lib/file_helper.rb#L58-L94","documentation":"A guard in FileHelper.download: raised as Discourse::InvalidParameters.new(:url) when the url argument (after prepending 'https:' to protocol-relative URLs) does not match %r{\\Ahttps?://}. The downloader refuses non-HTTP(S) schemes such as ftp:, file:, data:, or relative paths. The at-fault input is the url parameter.","triggerScenarios":"Thrown at lib/file_helper.rb:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a fully qualified http:// or https:// URL","Normalize scheme-relative //host/path URLs before calling, or rely on the built-in https: prefixing","Reject/repair malformed URLs at the caller before attempting the download"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","contentChangedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}