Opened 13 years ago
Closed 13 years ago
#5709 closed enhancement (fixed)
$.ajax() - type is json if dataType is unspecified and c-t is "application/json"
Reported by: | Rick Waldron | Owned by: | |
---|---|---|---|
Priority: | trivial | Milestone: | 1.4 |
Component: | ajax | Version: | 1.4a2 |
Keywords: | Cc: | Rick Waldron | |
Blocked by: | Blocking: |
Description
$.ajax() enhancement to treat a server's response ('data', from xhr.responseText) as json if dataType is unspecified and the response content-type is "application/json".
Attachments (1)
Change History (4)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
I think it's a more secure approach to require an explicit request for auto-detection/parsing. Otherwise, it wouldn't be out of the realm of possibility that scripts could be evaluated simply by leaving dataType unspecified (which many existing apps do).
I've created a ticket for a new dataType setting "auto" which provides this functionality:
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
http://github.com/rwldrn/jquery/commit/36658742ddb98528482bf415f3d48f31197890bd