CookieXSRFStrategy

XSRFConfiguration sets up Cross Site Request Forgery (XSRF) protection for the application using a cookie. See https://www.owasp.org/index.php/Cross-SiteRequest_Forgery(CSRF) for more information on XSRF.

查看"说明"...

已弃用: see https://angular.io/guide/http

      
      class CookieXSRFStrategy implements XSRFStrategy {
  constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
  configureRequest(req: Request): void
}
    

说明

Applications can configure custom cookie and header names by binding an instance of this class with different cookieName and headerName values. See the main HTTP documentation for more details.

构造函数

constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
      
      constructor(_cookieName: string = 'XSRF-TOKEN', _headerName: string = 'X-XSRF-TOKEN')
    
参数
_cookieName string

可选. 默认值是 'XSRF-TOKEN'.

_headerName string

可选. 默认值是 'X-XSRF-TOKEN'.

方法

configureRequest(req: Request): void
      
      configureRequest(req: Request): void
    
参数
req Request
返回值

void