fix(common): rename HttpXsrfModule to HttpClientXsrfModule

This commit is contained in:
Alex Rickabaugh 2017-07-14 09:44:33 -07:00
parent f7686d4124
commit 3ecc5e5398
3 changed files with 15 additions and 15 deletions

View File

@ -11,7 +11,7 @@ export {HttpClient} from './src/client';
export {HttpHeaders} from './src/headers';
export {HTTP_INTERCEPTORS, HttpInterceptor} from './src/interceptor';
export {JsonpClientBackend, JsonpInterceptor} from './src/jsonp';
export {HttpClientJsonpModule, HttpClientModule, HttpXsrfModule, interceptingHandler as ɵinterceptingHandler} from './src/module';
export {HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, interceptingHandler as ɵinterceptingHandler} from './src/module';
export {HttpParameterCodec, HttpParams, HttpUrlEncodingCodec} from './src/params';
export {HttpRequest} from './src/request';
export {HttpDownloadProgressEvent, HttpErrorResponse, HttpEvent, HttpEventType, HttpHeaderResponse, HttpProgressEvent, HttpResponse, HttpResponseBase, HttpSentEvent, HttpUserEvent} from './src/response';

View File

@ -70,13 +70,13 @@ export function jsonpCallbackContext(): Object {
{provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN'},
],
})
export class HttpXsrfModule {
export class HttpClientXsrfModule {
/**
* Disable the default XSRF protection.
*/
static disable(): ModuleWithProviders {
return {
ngModule: HttpXsrfModule,
ngModule: HttpClientXsrfModule,
providers: [
{provide: HttpXsrfInterceptor, useClass: NoopInterceptor},
],
@ -92,7 +92,7 @@ export class HttpXsrfModule {
headerName?: string,
} = {}): ModuleWithProviders {
return {
ngModule: HttpXsrfModule,
ngModule: HttpClientXsrfModule,
providers: [
options.cookieName ? {provide: XSRF_COOKIE_NAME, useValue: options.cookieName} : [],
options.headerName ? {provide: XSRF_HEADER_NAME, useValue: options.headerName} : [],
@ -111,7 +111,7 @@ export class HttpXsrfModule {
*/
@NgModule({
imports: [
HttpXsrfModule.withOptions({
HttpClientXsrfModule.withOptions({
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN',
}),

View File

@ -1004,6 +1004,15 @@ export declare class HttpClientJsonpModule {
export declare class HttpClientModule {
}
/** @experimental */
export declare class HttpClientXsrfModule {
static disable(): ModuleWithProviders;
static withOptions(options?: {
cookieName?: string;
headerName?: string;
}): ModuleWithProviders;
}
/** @experimental */
export interface HttpDownloadProgressEvent extends HttpProgressEvent {
partialText?: string;
@ -1246,15 +1255,6 @@ export declare class HttpXhrBackend implements HttpBackend {
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
}
/** @experimental */
export declare class HttpXsrfModule {
static disable(): ModuleWithProviders;
static withOptions(options?: {
cookieName?: string;
headerName?: string;
}): ModuleWithProviders;
}
/** @experimental */
export declare abstract class HttpXsrfTokenExtractor {
abstract getToken(): string | null;