Ticket #2529324 (closed enhancement)

Reporter


Logan Bowers
Opened: 09/16/10
Last modified: 01/14/11
Status: closed
Type: enhancement

Owner


Thomas S. Sha
Target Release: 3.3.0
Priority: P3 (normal)
Summary: Cannot unset headers on Y.io on a per-request basis
Description:

For some XDR XMLHttpRequests, I need to remove the 'X-Requested-With' value to avoid the preflight request. It'd be useful if headers specified as undefined in the Y.io cfg object were removed from
the request since I don't want to remove it for all requests.

Type: enhancement Observed in Version: development master
Component: IO Severity: S3 (normal)
Assigned To: Thomas S. Sha Target Release: 3.3.0
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: All
URL:
Test Information:

Change History

Thomas S. Sha

YUI Contributor

  • Username: tsha
Posted: 09/16/10
  • priority changed to P3 (normal)
  • status changed from new to infoneeded
Y.io.header() can be overloaded to add a new header or remove an existing header. To remove the custom header, try: Y.io.header('X-Requested-With');

This should remove the header from being set and sent with each request.

Thomas S. Sha

YUI Contributor

  • Username: tsha
Posted: 09/16/10
  • status changed from infoneeded to assigned

Disregard my response; I misread your post.

Thomas S. Sha

YUI Contributor

  • Username: tsha
Posted: 10/4/10
  • milestone changed to 3.3.0
  • status changed from assigned to accepted

George

YUI Developer

  • Username: george
Posted: 10/22/10
  • location changed to Library Code

Thomas S. Sha

YUI Contributor

  • Username: tsha
Posted: 10/23/10
  • status changed from accepted to checkedin

To suppress a default io header, set the exact header -- in the configuration object -- with a value of 'disable'. This will prevent the header from being sent for that request.

Example: Y.io('get.php, { headers: { 'X-Requested-With': 'disable'} } );

Checked into development master for nightly build.

George

YUI Developer

  • Username: george
Posted: 01/14/11
  • status changed from checkedin to closed