function addHttps(origin) {
  if (origin.indexOf('://') !== -1) {
    return origin;
  }
  return 'https://' + origin;
}
/**
 * Convert a domain (example.com) into a valid web origin (https://example.com).
 *
 * This is needed because the origin value may ultimately come from the
 * `custom_canvas_api_domain` LTI launch parameter on the backend, in which
 * case it may be a domain rather than a URL. If so, this should really be handled
 * on the backend.
 *
 * @param {string} origin
 */
Convert a domain (example.com) into a valid web origin .
This is needed because the origin value may ultimately come from the
`custom_canvas_api_domain` LTI launch parameter on the backend, in which
case it may be a domain rather than a URL. If so, this should really be handled
on the backend.

@param {string} origin
Convert a domain ( example . com ) into a valid web origin . This is needed because the origin value may ultimately come from the ` custom_canvas_api_domain ` LTI launch parameter on the backend in which case it may be a domain rather than a URL . If so this should really be handled on the backend . @param { string } origin
function addHttps(origin) {
  if (origin.indexOf('://') !== -1) {
    return origin;
  }
  return 'https://' + origin;
}
function addHttps ( origin ) { if ( origin . indexOf ( '://' ) !== - 1 ) { return origin ; } return 'https://' + origin ; }
Convert a domain (example.com) into a valid web origin (https://example.com).
Convert a domain ( example . com ) into a valid web origin ( https : // example . com ) .