Compare commits

...

1 Commits

Author SHA1 Message Date
Ben Hong d63f71931e docs: fix outdated security guide reference 2024-03-27 11:10:49 -07:00
+8 -8
View File
@@ -83,11 +83,11 @@ HELPFUL: Prefer using [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/C
### `withXsrfConfiguration(...)`
Including this option allows for customization of `HttpClient`'s built-in XSRF security functionality. See the [security guide](guide/http/security) for more information.
Including this option allows for customization of `HttpClient`'s built-in XSRF security functionality. See the [security guide](best-practices/security) for more information.
### `withNoXsrfProtection()`
Including this option disables `HttpClient`'s built-in XSRF security functionality. See the [security guide](guide/http/security) for more information.
Including this option disables `HttpClient`'s built-in XSRF security functionality. See the [security guide](best-practices/security) for more information.
## `HttpClientModule`-based configuration
@@ -95,12 +95,12 @@ Some applications may configure `HttpClient` using the older API based on NgModu
This table lists the NgModules available from `@angular/common/http` and how they relate to the provider configuration functions above.
| **NgModule** | `provideHttpClient()` equivalent |
| - | - |
| `HttpClientModule` | `provideHttpClient(withInterceptorsFromDi())` |
| `HttpClientJsonpModule` | `withJsonpSupport()` |
| `HttpClientXsrfModule.withOptions(...)` | `withXsrfConfiguration(...)` |
| `HttpClientXsrfModule.disable()` | `withNoXsrfProtection()` |
| **NgModule** | `provideHttpClient()` equivalent |
| --------------------------------------- | --------------------------------------------- |
| `HttpClientModule` | `provideHttpClient(withInterceptorsFromDi())` |
| `HttpClientJsonpModule` | `withJsonpSupport()` |
| `HttpClientXsrfModule.withOptions(...)` | `withXsrfConfiguration(...)` |
| `HttpClientXsrfModule.disable()` | `withNoXsrfProtection()` |
<docs-callout important title="Use caution when using HttpClientModule in multiple injectors">
When `HttpClientModule` is present in multiple injectors, the behavior of interceptors is poorly defined and depends on the exact options and provider/import ordering.