Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69203

Mobile app requests fail because moodle doesn't send CORS header

    XMLWordPrintable

Details

    • MOODLE_38_STABLE, MOODLE_39_STABLE

    Description

      Tested on https://school.moodledemo.net and the latest 3.9 moodle app.

      With the latest update to the Moodle app it now respects CORS headers, these are sent on web service requests but not on the requests made under admin/tool/mobile/ directory and /lib/ajax/service.php file.

      Here's an example:

      07-06 08:35:49.398 14884 14884 D SystemWebChromeClient: http://localhost/: Line 0 : Access to XMLHttpRequest at 'https://school.moodledemo.net/lib/ajax/service.php?info=tool_mobile_get_public_config' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
      

      Steps to reproduce:

      1. Download official moodle app
      2. Connect to device with adb logcat
      3. Configure site to be school.moodledemo.net
      4. Close and reopen app
      5. Look in logcat to see failing requests

      Attachments

        Activity

          People

            Unassigned Unassigned
            alexmorris Alexander Morris
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: