chore: remove deep imports to fix build.
This commit is contained in:
parent
4d793c4eb8
commit
10475b859d
|
@ -9,7 +9,9 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"@angular/core": "0.0.0-PLACEHOLDER"
|
"@angular/core": "0.0.0-PLACEHOLDER",
|
||||||
|
"@angular/common": "0.0.0-PLACEHOLDER",
|
||||||
|
"@angular/platform-browser": "0.0.0-PLACEHOLDER"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {Injectable} from '@angular/core';
|
||||||
|
import {__platform_browser_private__} from '@angular/platform-browser';
|
||||||
|
|
||||||
import {ConnectionBackend, Connection, XSRFStrategy} from '../interfaces';
|
import {ConnectionBackend, Connection, XSRFStrategy} from '../interfaces';
|
||||||
import {ReadyState, RequestMethod, ResponseType, ContentType} from '../enums';
|
import {ReadyState, RequestMethod, ResponseType, ContentType} from '../enums';
|
||||||
|
@ -6,7 +7,6 @@ import {Request} from '../static_request';
|
||||||
import {Response} from '../static_response';
|
import {Response} from '../static_response';
|
||||||
import {Headers} from '../headers';
|
import {Headers} from '../headers';
|
||||||
import {ResponseOptions} from '../base_response_options';
|
import {ResponseOptions} from '../base_response_options';
|
||||||
import {Injectable} from '@angular/core';
|
|
||||||
import {BrowserXhr} from './browser_xhr';
|
import {BrowserXhr} from './browser_xhr';
|
||||||
import {isPresent, isString} from '../../src/facade/lang';
|
import {isPresent, isString} from '../../src/facade/lang';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
@ -150,7 +150,7 @@ export class CookieXSRFStrategy implements XSRFStrategy {
|
||||||
private _cookieName: string = 'XSRF-TOKEN', private _headerName: string = 'X-XSRF-TOKEN') {}
|
private _cookieName: string = 'XSRF-TOKEN', private _headerName: string = 'X-XSRF-TOKEN') {}
|
||||||
|
|
||||||
configureRequest(req: Request) {
|
configureRequest(req: Request) {
|
||||||
let xsrfToken = getDOM().getCookie(this._cookieName);
|
let xsrfToken = __platform_browser_private__.getDOM().getCookie(this._cookieName);
|
||||||
if (xsrfToken && !req.headers.has(this._headerName)) {
|
if (xsrfToken && !req.headers.has(this._headerName)) {
|
||||||
req.headers.set(this._headerName, xsrfToken);
|
req.headers.set(this._headerName, xsrfToken);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {BrowserXhr} from '../../src/backends/browser_xhr';
|
||||||
import {XSRFStrategy} from '../../src/interfaces';
|
import {XSRFStrategy} from '../../src/interfaces';
|
||||||
import {XHRConnection, XHRBackend, CookieXSRFStrategy} from '../../src/backends/xhr_backend';
|
import {XHRConnection, XHRBackend, CookieXSRFStrategy} from '../../src/backends/xhr_backend';
|
||||||
import {provide, Injector, Injectable, ReflectiveInjector} from '@angular/core';
|
import {provide, Injector, Injectable, ReflectiveInjector} from '@angular/core';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {__platform_browser_private__} from '@angular/platform-browser';
|
||||||
import {Request} from '../../src/static_request';
|
import {Request} from '../../src/static_request';
|
||||||
import {Response} from '../../src/static_response';
|
import {Response} from '../../src/static_response';
|
||||||
import {Headers} from '../../src/headers';
|
import {Headers} from '../../src/headers';
|
||||||
|
@ -118,6 +118,7 @@ export function main() {
|
||||||
() => { expect(() => backend.createConnection(sampleRequest)).not.toThrow(); });
|
() => { expect(() => backend.createConnection(sampleRequest)).not.toThrow(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getDOM = __platform_browser_private__.getDOM;
|
||||||
if (getDOM().supportsCookies()) {
|
if (getDOM().supportsCookies()) {
|
||||||
describe('XSRF support', () => {
|
describe('XSRF support', () => {
|
||||||
it('sets an XSRF header by default', () => {
|
it('sets an XSRF header by default', () => {
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../../dist/packages-dist/http/esm",
|
"outDir": "../../../dist/packages-dist/http/esm",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"]
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||||
},
|
},
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../../dist/packages-dist/http/",
|
"outDir": "../../../dist/packages-dist/http/",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"]
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||||
},
|
},
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
|
Loading…
Reference in New Issue