Bug Tracker

Ticket #7428 (closed enhancement: invalid)

Opened 5 years ago

Last modified 4 years ago

Custom Ajax Headers should not require explicit type (GET|POST)

Reported by: rwaldron Owned by:
Priority: low Milestone:
Component: ajax Version:
Keywords: needsreview,ajaxrewrite Cc: john, dmethvin, addyosmani, ajpiano, slexaxton
Blocking: Blocked by:


This was a byproduct of: http://bugs.jquery.com/ticket/7424

End developer should be able to set custom ajax/xhr headers whether or not the type property is set in a given request.

Change History

comment:1 Changed 5 years ago by rwaldron

  • Cc john, dmethvin, snover, addyosmani, ajpiano, slexaxton added
  • Keywords needsreview added
  • Component changed from unfiled to ajax
  • Priority changed from undecided to low

I'd like to open the floor for discussion on this enhancement

comment:2 Changed 5 years ago by snover

  • Cc snover removed

comment:3 Changed 5 years ago by dmethvin

I can't see where $.ajax prevents the call to beforeSend, which is where the reporter in #7424 was trying to set headers. Maybe it fell into the jsonp case? A specific test case would help.

comment:4 Changed 5 years ago by rwaldron

  • Keywords needsreview,ajaxrewrite added; needsreview removed

comment:5 Changed 5 years ago by jaubourg

There's no limitation I know of in current code that would prevent setting headers based on the type or even dataType options. Of course, whether or not the headers are actually transmitted will depend on the transport (so you can set them all you want when doing jsonp, they won't get sent for cross-domain requests).

comment:6 Changed 5 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid

Yeah, I don't think there's an issue here.

Note: See TracTickets for help on using tickets.