Moodle
  1. Moodle
  2. MDL-42985

The curl rule proxybypass is never applied

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6.1
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide
      1. Save the example from the description in a test.php page
        • You must use your .moodle.local address
      2. Set up a fake proxy host in your Moodle settings
      3. Do not set your .moodle.local host in the proxybypass setting
      4. Make sure the curl request returns an error
      5. Add your .moodle.local to proxybypass
      6. Make sure the curl request works fine
      Show
      Save the example from the description in a test.php page You must use your .moodle.local address Set up a fake proxy host in your Moodle settings Do not set your .moodle.local host in the proxybypass setting Make sure the curl request returns an error Add your .moodle.local to proxybypass Make sure the curl request works fine
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-42985-master
    • Rank:
      54889

      Description

      While working on MDL-42951, I realised that the setting proxybypass was not observed.

      Set Moodle to use a fake proxy server, and add your .moodle.local address to the proxybypass. The request below should work.

      require_once($CFG->dirroot . '/lib/filelib.php');
      $curl = new curl(array('debug' => true));
      $curl->post('http://fred.moodle.local/im/test.php');
      

        Issue Links

          Activity

          Hide
          Frédéric Massart added a comment - - edited

          Using the array $options['url'] will set CURLOPT_URL after we've made a check on is_proxypass().

          Ping Petr Škoda.

          Show
          Frédéric Massart added a comment - - edited Using the array $options ['url'] will set CURLOPT_URL after we've made a check on is_proxypass(). Ping Petr Škoda .
          Hide
          Petr Škoda added a comment -

          makes sense, +1, thanks a lot!
          hmmm, maybe, could we have some tests for this please?

          Show
          Petr Škoda added a comment - makes sense, +1, thanks a lot! hmmm, maybe, could we have some tests for this please?
          Hide
          Frédéric Massart added a comment -

          Thanks Petr, I've done that. Pushing for integration.

          Show
          Frédéric Massart added a comment - Thanks Petr, I've done that. Pushing for integration.
          Hide
          Damyon Wiese added a comment -

          Thanks Fred and Petr.

          Integrated to 26 and master.

          Show
          Damyon Wiese added a comment - Thanks Fred and Petr. Integrated to 26 and master.
          Hide
          Rajesh Taneja added a comment -

          Thanks for fixing this Fred,

          Works fine.. Passing...

          Show
          Rajesh Taneja added a comment - Thanks for fixing this Fred, Works fine.. Passing...
          Hide
          Dan Poltawski added a comment -

          Congratulations, this change has now made its way upstream. Thanks for your contribution!

          “ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ” - Rick Osborne

          Show
          Dan Poltawski added a comment - Congratulations, this change has now made its way upstream. Thanks for your contribution! “ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ” - Rick Osborne

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: