iron-ajax icon indicating copy to clipboard operation
iron-ajax copied to clipboard

jsonPrefix removes entire event.detail.response

Open dman777 opened this issue 7 years ago • 0 comments

Description

jsonPrefix removes entire event.detail.response

Expected outcome

foo is stripped from { foo: [object, object, object] } event.detail.response should exist with { [object, object, object] } or just [object, object, object] I expect this from the linked article from docs:

The ASP.NET AJAX library uses the “d” parameter formatting for JSON data. This forces the data in the example to appear in the following form: {“d” : [“bankaccountnumber”, “$1234.56”] } Because this is not a valid JavaScript statement, it cannot be parsed and instantiated as a new object in JavaScript. This therefore prevents the cross-site scripting attack from accessing data from AJAX JSON services on other domains. The Microsoft Ajax client libraries automatically strip the “d” out, but other client libraries, such as JQuery, would have to take the “d” property into account when using such services.

Steps to reproduce

  1. json-prefix='foo'
  2. json returned from api call is { foo: [object, object, object] }
  3. After jsonPrefix, entire json is gone. event.detail.response is none existant.

Browsers Affected

  • [X ] Chrome
  • [ ] Firefox
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] Safari 7
  • [ ] Edge
  • [ ] IE 11
  • [ ] IE 10

dman777 avatar Oct 01 '16 01:10 dman777