Skip to content

Commit

Permalink
fix(http): REVERT: remove dots from jsonp callback name (#13219)
Browse files Browse the repository at this point in the history
This reverts commit 9e5617e.
  • Loading branch information
mhevery committed Feb 9, 2017
1 parent 45cc444 commit 4676df5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 5 additions & 5 deletions modules/@angular/http/src/backends/browser_jsonp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
5 changes: 0 additions & 5 deletions modules/@angular/http/test/backends/jsonp_backend_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

1 comment on commit 4676df5

@IgorMinar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was reverted because of the following regression: #14267

Please sign in to comment.