Moodle
  1. Moodle
  2. MDL-37173

File Manager in Chrome throws Refused to set unsafe header "User-Agent"

    Details

    • Testing Instructions:
      Hide
      • Open the file manager
      • Confirm that you can browse around and get a list of files returned
      • Confirm that no errors/warnings were shown in the JS console
      • Add the 'comments' block
      • Add a comment
      • Confirm that no errors/warnings were shown in the JS console
      • Refresh the page
      • Confirm that your comment appears
      Show
      Open the file manager Confirm that you can browse around and get a list of files returned Confirm that no errors/warnings were shown in the JS console Add the 'comments' block Add a comment Confirm that no errors/warnings were shown in the JS console Refresh the page Confirm that your comment appears
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:

      Description

      When the File Manager (e.g. My Private Files) is loaded in the Chrome browser (Version 23.0.1271.97), the following javascript error is displayed in Firebug:
      Refused to set unsafe header "User-Agent"

        Gliffy Diagrams

          Activity

          Hide
          Andrew Nicols added a comment -

          I'm aware of this one too. I thought that there was a bug for it somewhere, but I've been unable to find it.

          There are several places that this warning is shown. Some of our JS attempts to set the user-agent and I'd argue that they shouldn't too.

          I can sort of see the purpose, and it is useful to have it in the logs, but since some browsers (Webkit only AFAIK) don't allow changing of the User Agent, this is moot anyway.

          Propose to strip and remove these changes out of JS.

          Show
          Andrew Nicols added a comment - I'm aware of this one too. I thought that there was a bug for it somewhere, but I've been unable to find it. There are several places that this warning is shown. Some of our JS attempts to set the user-agent and I'd argue that they shouldn't too. I can sort of see the purpose, and it is useful to have it in the logs, but since some browsers (Webkit only AFAIK) don't allow changing of the User Agent, this is moot anyway. Propose to strip and remove these changes out of JS.
          Hide
          Andrew Nicols added a comment -

          Unsure whether this should be backported to stable branches or not.

          Show
          Andrew Nicols added a comment - Unsure whether this should be backported to stable branches or not.
          Hide
          Dan Poltawski added a comment -

          Hi Andrew,

          Looks good +1. Since we fix E_STRICT problems in the stable branches i'd argue we should accept this too. But leave the final call to the integrator.

          (Please create branches and submit).

          Show
          Dan Poltawski added a comment - Hi Andrew, Looks good +1. Since we fix E_STRICT problems in the stable branches i'd argue we should accept this too. But leave the final call to the integrator. (Please create branches and submit).
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (23, 24 & master), thanks!

          PS: 22 is out from support so (toe).

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks! PS: 22 is out from support so (toe).
          Hide
          Ankit Agarwal added a comment -

          Works as described.
          Thanks

          Show
          Ankit Agarwal added a comment - Works as described. Thanks
          Hide
          Dan Poltawski added a comment -

          Hurray! We did it! Thanks to all the reporters, testers, user and watchers for a bumper week of Moodling!

          Show
          Dan Poltawski added a comment - Hurray! We did it! Thanks to all the reporters, testers, user and watchers for a bumper week of Moodling!

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: