Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

CORS Issues with WebGL build due to Unity's own X-Unity-Version Header

Discussion in 'WebGL' started by JJJohan, May 3, 2016.

  1. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    My dev team had reported an issue some time ago (see: https://issuetracker.unity3d.com/is...request-blocked-due-to-x-unity-version-header), sadly it's pretty evident it is slowly fading away into the issue tracker void. I don't intend to come here to complain, but rather to ask the community if anyone is familiar with any methods for stripping unity headers completely before messages are sent using the UnityWebRequest API.

    It is not viable to modify the CORS headers on the server-side for one application when our existing systems use it, but we intend to replace it with our Unity solution, where one of our requirements is a WebGL deployment. This CORS header issue has been a rather painful obstacle during our development and any advice would be greatly appreciated.
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I was not aware of this issue, but yes, this does not make sense. It turns out that we have already been disabling this header for the WWW class for the same reason, but not for WebRequest. We will change that, change should land in Unity 5.5.
     
  3. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    Thanks Jonas, I'm glad to see this issue seeing the light further down the roadmap.
     
  4. Chris-HG

    Chris-HG

    Joined:
    Aug 10, 2012
    Posts:
    63
    I can confirm that there is no preflight using UnityWebRequest in 5.4.0f3 on FF48.0.1_OSX due to x-unity-version, meaning that the header is not present.

    /c