New URL adaptor not allowing "withCredentials" to set as "true", to include cookies in header for DataManager requests, after upgrading to v26.

Hello there,

We have this problem with new version of Syncfusion (version 26.2.5). We used to allow cookies in request headers like this:


export class CustomAdaptor extends UrlAdaptor {
  constructor(){
    super();
  }


  public override beforeSend(argsDataManager, xhrXMLHttpRequest): void {
    xhr.withCredentials true;
    super.beforeSend(args, xhr);
  }
}


After upgrading Syncfusion to newer version, it seems that request used before is different from the new one (I think it used to be "XMLHttpRequest" and now it's type of "Fetch"). We try to adjust the beforeSend() function to meet new standard, but cookies are still not sent in headers.


export class CustomAdaptor extends UrlAdaptor {
  constructor(){
    super();
  }


  public override beforeSend(argsDataManager, xhrRequest): void {
    const request new Request(xhr.url,{
      credentials'include',
    });
    super.beforeSend(args, request);
  }
}


Any help is warmly welcome, best regards.


2 Replies 1 reply marked as answer

JS Johnson Soundararajan S Syncfusion Team August 21, 2024 03:45 PM UTC

Hi Vojtech Popelak,


Greetings from Syncfusion support.


We have confirmed that the reported case is an issue from our side and logged it as “Unable to send cookies with request header while using customAdaptor extending the UrlAdaptor”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technical feasibility and Product Development Life Cycle ) and will include the defect fix in our upcoming patch release which will be rolled out on “September 10th, 2024”.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link,


Feedback: https://www.syncfusion.com/feedback/60567/unable-to-send-cookies-with-request-header-while-using-customadaptor-extending-the


Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization".


Regards

Johnson S


Marked as answer

AR Aishwarya Rameshbabu Syncfusion Team September 10, 2024 04:20 PM UTC

Hi Vojtech Popelak,

 

We are glad to announce that, we have included the fix for the issue “Unable to send cookies with request header while using customAdaptor extending the UrlAdaptor” in our 26.2.14 release. So please upgrade to our latest version of the Syncfusion package to resolve the reported issue.

 

Root Cause: The Fetch instance is not passed as an argument to the beforeSend method of UrlAdaptor.

 

Solution: Passed the Fetch instance as an argument to the beforeSend method of UrlAdaptor.

 

Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/26.2.14?type=all#grid

 

Sample: 24phmc (forked) - StackBlitz

   

Feedback: https://www.syncfusion.com/feedback/60567/unable-to-send-cookies-with-request-header-while-using-customadaptor-extending-the

 

We thank you for your support and appreciate your patience in waiting for this release. Please get back to us if you need any further assistance.

 

 

Regards,

Aishwarya R


Loader.
Up arrow icon