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,9 +11,9 @@ export {HttpClient} from './src/client';
export {HttpHeaders} from './src/headers'; export {HttpHeaders} from './src/headers';
export {HTTP_INTERCEPTORS, HttpInterceptor} from './src/interceptor'; export {HTTP_INTERCEPTORS, HttpInterceptor} from './src/interceptor';
export {JsonpClientBackend, JsonpInterceptor} from './src/jsonp'; 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 {HttpParameterCodec, HttpParams, HttpUrlEncodingCodec} from './src/params';
export {HttpRequest} from './src/request'; export {HttpRequest} from './src/request';
export {HttpDownloadProgressEvent, HttpErrorResponse, HttpEvent, HttpEventType, HttpHeaderResponse, HttpProgressEvent, HttpResponse, HttpResponseBase, HttpSentEvent, HttpUserEvent} from './src/response'; export {HttpDownloadProgressEvent, HttpErrorResponse, HttpEvent, HttpEventType, HttpHeaderResponse, HttpProgressEvent, HttpResponse, HttpResponseBase, HttpSentEvent, HttpUserEvent} from './src/response';
export {HttpXhrBackend, XhrFactory} from './src/xhr'; export {HttpXhrBackend, XhrFactory} from './src/xhr';
export {HttpXsrfTokenExtractor} from './src/xsrf'; export {HttpXsrfTokenExtractor} from './src/xsrf';

View File

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

View File

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