Sets/updated redirect headers
511840
protected function setRedirectHeaders()
    {
        $this->header->remove('Location');
        $this->header->remove('Refresh');

        if ($this->delay) {
            $this->header->set('Refresh', $this->delay . '; URL=' . $this->address);

            return;
        }

        $this->header->set('Location', $this->address);
    }
118343
def set_headers(self) -> None:
        
        self.set_header("Accept-Ranges", "bytes")
        self.set_etag_header()

        if self.modified is not None:
            self.set_header("Last-Modified", self.modified)

        content_type = self.get_content_type()
        if content_type:
            self.set_header("Content-Type", content_type)

        cache_time = self.get_cache_time(self.path, self.modified, content_type)
        if cache_time > 0:
            self.set_header(
                "Expires",
                datetime.datetime.utcnow() + datetime.timedelta(seconds=cache_time),
            )
            self.set_header("Cache-Control", "max-age=" + str(cache_time))

        self.set_extra_headers(self.path)
1300248
function setHeaders($headers){
		$this->debug("setHeaders headers=");
		$this->appendDebug($this->varDump($headers));
		$this->requestHeaders = $headers;
	}
67688
def UpdateDNS(self, domain, environment):
        """"""
        self.dns_set_conf(domain, self.dns.config,
                          environment, self.dns.token)
40621
def _set_default_headers(self):
        
        self.headers.setdefault('Date', self.get_current_time)
        self.headers.setdefault('Server', self.SERVER_INFO)
        self.headers.setdefault('Content-Length', "%d" % len(self.message))
        if self.app.enabled('x-powered-by'):
            self.headers.setdefault('X-Powered-By', 'Growler')
697851
def refresh(custom_headers:nil)
      response = refresh_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
207326
public function setRedirectUrl($options)
    {
        $this->redirectUrl = array(
            404 => !isset($options[404]) ? '' : $options[404],
            405 => !isset($options[405]) ? '' : $options[405]
        );
    }
1017487
private void addKeepAliveHeaders(HttpHeaders headers) {
        if (protocol == H1 || protocol == H1C) {
            headers.set(HttpHeaderNames.CONNECTION, "keep-alive");
        } else {
            // Do not add the 'connection' header for HTTP/2 responses.
            // See https://tools.ietf.org/html/rfc7540#section-8.1.2.2
        }
    }
1367863
def update_headers(self, headers: Optional[LooseHeaders]) -> None:
        """"""
        self.headers = CIMultiDict()  # type: CIMultiDict[str]

        # add host
        netloc = cast(str, self.url.raw_host)
        if helpers.is_ipv6_address(netloc):
            netloc = '[{}]'.format(netloc)
        if not self.url.is_default_port():
            netloc += ':' + str(self.url.port)
        self.headers[hdrs.HOST] = netloc

        if headers:
            if isinstance(headers, (dict, MultiDictProxy, MultiDict)):
                headers = headers.items()  # type: ignore

            for key, value in headers:
                # A special case for Host header
                if key.lower() == 'host':
                    self.headers[key] = value
                else:
                    self.headers.add(key, value)
139034
private function changeHostFromUri()
    {
        $host = $this->uri->getHost();

        if ($host === '') {
            return;
        }

        if (($port = $this->uri->getPort()) !== null) {
            $host .= ':' . $port;
        }

        $this->headers['Host'] = [$host];

        $this->rearrangeHostHeaderKey();
    }
1225194
public function update(Redirect $redirect, UpdateRedirectRequest $request)
    {
        $this->authorize(RedirectsPolicy::PERMISSION_UPDATE);

        $redirect->update($request->getValidatedData());

        $this->transNotification('updated', [], $redirect->toArray());

        return redirect()->route('admin::seo.redirects.show', [$redirect]);
    }
455230
function redirect($url, $type = 303) {
		if ($type == 303) {
			// 303 See Other
			$this->responseCode(303);
		}
		else if ($type == 301) {
			// 301 Moved Permanently
			$this->responseCode(301);
		}
		else if ($type == 307) {
			// 307 Temporary Redirect
			$this->responseCode(307);
		}

		// redirect to...
		$this->header("Location: $url");
	}
459887
def update_redirect(self):
        
        page_history = Stack(session.get("page_history", []))
        page_history.push(request.url)
        session["page_history"] = page_history.to_json()
769405
public static function redirect($url, $status = 302, $headers = array())
    {
        $redirect = new RedirectResponse($url, $status, $headers);
        $redirect->sendHeaders();
        die();
    }
1098718
private function setRequestHeaders($headers = array()) {
        foreach ($this->headers as $key => $value) {
            $headers[] = $key . ': ' . $value;
        }
        curl_setopt($this->request, CURLOPT_HTTPHEADER, $headers);
    }
986913
function (urlpath, dirs) {
    dirs.forEach(function (val, idx) {
        redirectTo(urlpath, false);
        addDeepDir(urlpath, val);
    });
}
760016
function setOverrideHeader(res, name, value) {

  if (res._headers && res._headers[name] !== undefined) {
    return true;
  }

  res.setHeader(name, value);
  return true;
}