Spec-Zone.ru › Angular

createWebRequestFromNodeRequest

Converts a Node.js IncomingMessage or Http2ServerRequest into a Web Standard Request object.

API

function createWebRequestFromNodeRequest(
  nodeRequest: IncomingMessage | Http2ServerRequest,
  trustProxyHeaders?: boolean | readonly string[] | undefined,
): Request;
@paramnodeRequestIncomingMessage | Http2ServerRequest
  • The Node.js request object (IncomingMessage or Http2ServerRequest) to convert.
@paramtrustProxyHeadersboolean | readonly string[] | undefined
  • A boolean or an array of proxy headers to trust when constructing the request URL.
@returnsRequest

A Web Standard Request object.

Description

Converts a Node.js IncomingMessage or Http2ServerRequest into a Web Standard Request object.

This function adapts the Node.js request objects to a format that can be used by web platform APIs.

Usage Notes

When trustProxyHeaders is enabled, headers such as X-Forwarded-Host and X-Forwarded-Prefix should ideally be strictly validated at a higher infrastructure level (e.g., at the reverse proxy or API gateway) before reaching the application.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/ssr/node/createWebRequestFromNodeRequest

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API