def viewer()

in app/com/gu/viewer/controllers/Application.scala [35:48]


  def viewer(target: String, path: String, previewEnv: String) = AuthAction { implicit request =>
    val protocol = if (request.secure) "https" else "http"
    val viewerHost = target match {
      case "preview" => config.previewHost
      case _ => config.liveHost
    }
    val actualUrl = s"$protocol://$viewerHost/$path"
    // TODO rename viewerUrl to iframeSrc and ideally eliminate the proxy all together for preview (following https://github.com/guardian/frontend/pull/27012)
    val viewerUrl = routes.Proxy.proxy(target, path).path()
    val proxyBase = routes.Proxy.proxy(target, "").absoluteURL()
    val composerUrl = config.composerReturn + "/" + path

    Ok(html.viewer(viewerUrl, actualUrl, previewEnv, composerUrl, proxyBase, path, config.googleTrackingId, CSRF.getToken))
  }