fix(http): REVERT: remove dots from jsonp callback name (#13219)

This reverts commit 9e5617e41e.
This commit is contained in:
Miško Hevery 2017-02-09 13:31:30 -06:00
parent 45cc444154
commit 4676df5833
2 changed files with 5 additions and 10 deletions

View File

@ -32,23 +32,23 @@ export class BrowserJsonp {
nextRequestID(): string { return `__req${_nextRequestId++}`; }
requestCallback(id: string): string { return `${JSONP_HOME}${id}_finished`; }
requestCallback(id: string): string { return `${JSONP_HOME}.${id}.finished`; }
exposeConnection(id: string, connection: any): void {
exposeConnection(id: string, connection: any) {
const connections = _getJsonpConnections();
connections[id] = connection;
}
removeConnection(id: string): void {
removeConnection(id: string) {
const connections = _getJsonpConnections();
connections[id] = null;
}
// Attach the <script> element to the DOM
send(node: any): void { document.body.appendChild(<Node>(node)); }
send(node: any) { document.body.appendChild(<Node>(node)); }
// Remove <script> element from the DOM
cleanup(node: any): void {
cleanup(node: any) {
if (node.parentNode) {
node.parentNode.removeChild(<Node>(node));
}

View File

@ -70,11 +70,6 @@ export function main() {
expect(instance).toBeAnInstanceOf(JSONPConnection);
});
it('callback name should not contain dots', () => {
const domJsonp = new MockBrowserJsonp();
const callback: string = domJsonp.requestCallback(domJsonp.nextRequestID());
expect(callback.indexOf('.') === -1).toBeTruthy();
});
describe('JSONPConnection', () => {
it('should use the injected BaseResponseOptions to create the response',