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

The curl rule proxybypass is never applied

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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');
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              fred 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 Skoda.

              Show
              fred 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 Skoda .
              Hide
              skodak Petr Skoda added a comment -

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

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

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

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

              Thanks Fred and Petr.

              Integrated to 26 and master.

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

              Thanks for fixing this Fred,

              Works fine.. Passing...

              Show
              rajeshtaneja Rajesh Taneja added a comment - Thanks for fixing this Fred, Works fine.. Passing...
              Hide
              poltawski 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
              poltawski 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:
                    Fix Release Date:
                    13/Jan/14