chore: remove deep imports to fix build.
This commit is contained in:
parent
4d793c4eb8
commit
10475b859d
|
@ -9,7 +9,9 @@
|
|||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"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": {
|
||||
"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 {ReadyState, RequestMethod, ResponseType, ContentType} from '../enums';
|
||||
|
@ -6,7 +7,6 @@ import {Request} from '../static_request';
|
|||
import {Response} from '../static_response';
|
||||
import {Headers} from '../headers';
|
||||
import {ResponseOptions} from '../base_response_options';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {BrowserXhr} from './browser_xhr';
|
||||
import {isPresent, isString} from '../../src/facade/lang';
|
||||
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') {}
|
||||
|
||||
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)) {
|
||||
req.headers.set(this._headerName, xsrfToken);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import {BrowserXhr} from '../../src/backends/browser_xhr';
|
|||
import {XSRFStrategy} from '../../src/interfaces';
|
||||
import {XHRConnection, XHRBackend, CookieXSRFStrategy} from '../../src/backends/xhr_backend';
|
||||
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 {Response} from '../../src/static_response';
|
||||
import {Headers} from '../../src/headers';
|
||||
|
@ -118,6 +118,7 @@ export function main() {
|
|||
() => { expect(() => backend.createConnection(sampleRequest)).not.toThrow(); });
|
||||
});
|
||||
|
||||
const getDOM = __platform_browser_private__.getDOM;
|
||||
if (getDOM().supportsCookies()) {
|
||||
describe('XSRF support', () => {
|
||||
it('sets an XSRF header by default', () => {
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/http/esm",
|
||||
"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": ".",
|
||||
"sourceMap": true,
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/http/",
|
||||
"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": ".",
|
||||
"sourceMap": true,
|
||||
|
|
Loading…
Reference in New Issue