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

Wrong redirect after MDL-80823

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-81035-403
    • MDL-81035-main
    • Hide

      First test - Copied from MDL-80823

      1) Setup an environment that is served over multiple domain names at the same time, eg oldurl.localhost and newurl.localhost

      2) Set $CFG->debug = (E_ALL | E_STRICT); to show the full x-redirect headers

      3) Configure Moodle to use the 'new' url eg $CFG->wwwroot = 'https://newurl.localhost';

      4) Curl a deep link inside moodle which has both path info and query params using the oldurl eg

      curl -I --insecure https://oldurl.localhost/my/courses.php/path_info?query=param
      HTTP/1.1 303 See Other
      Server: nginx/1.18.0 (Ubuntu)
      Date: Mon, 05 Feb 2024 05:15:57 GMT
      Content-Type: text/html; charset=UTF-8
      Connection: keep-alive
      X-Powered-By: PHP/8.1.2-1ubuntu2.14
      X-Redirect-By: Moodle /lib/setuplib.php:964
      Location: https://newurl.localhost/my/courses.php/path_info?query=param
      Content-Language: en
      

      5) Confirm that you see the X-Redirect-By which means the redirect was served by Moodle and not by nginx / apache

      6) Confirm that you see the same path and query string as the original request in the Location header eg:

      Location: https://newurl.localhost/my/courses.php/path_info?query=param

       

      Second test

      1. Open your config.php.
      2. Change $CFG->wwwroot to http://192.168.x.y/[your_moodle] (With 192.168.x.y is your local area network.
      3. On the browser, navigate to http://localhost/[your_moodle].
      4. Verify that you will be redirected to http://192.168.x.y/[your_moodle]
      Show
      First test - Copied from MDL-80823 1) Setup an environment that is served over multiple domain names at the same time, eg oldurl.localhost and newurl.localhost 2) Set $CFG->debug = (E_ALL | E_STRICT); to show the full x-redirect headers 3) Configure Moodle to use the 'new' url eg $CFG->wwwroot = 'https://newurl.localhost'; 4) Curl a deep link inside moodle which has both path info and query params using the oldurl eg curl -I --insecure https://oldurl.localhost/my/courses.php/path_info?query=param HTTP/1.1 303 See Other Server: nginx/1.18.0 (Ubuntu) Date: Mon, 05 Feb 2024 05:15:57 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/8.1.2-1ubuntu2.14 X-Redirect-By: Moodle /lib/setuplib.php:964 Location: https://newurl.localhost/my/courses.php/path_info?query=param Content-Language: en 5) Confirm that you see the X-Redirect-By which means the redirect was served by Moodle and not by nginx / apache 6) Confirm that you see the same path and query string as the original request in the Location header eg: Location: https://newurl.localhost/my/courses.php/path_info?query=param   Second test Open your config.php. Change $CFG->wwwroot to  http://192.168.x.y/[your_moodle]  (With 192.168.x.y is your local area network. On the browser, navigate to  http://localhost/[your_moodle]. Verify that you will be redirected to http://192.168.x.y/[your_moodle]
    • 2
    • Team Hedgehog 2024 Sprint 1.2

      We're facing a wrong redirect after MDL-80823

      Steps to replicate:

      1. Open your config.php.
      2. Change $CFG->wwwroot to http://192.168.x.y/[your_moodle] (With 192.168.x.y is your local area network.
      3. On the browser, navigate to http://localhost/[your_moodle].
      4. Verify the result page.

      Expected behavior: You will be redirect to http://192.168.x.y/[your_moodle]

      Actual behaviour: You are redirected to [http://192.168.x.y/[your_moodle]/[your_moodle]]

       

            huongn@moodle.com Huong Nguyen
            huongn@moodle.com Huong Nguyen
            Stevani Andolo Stevani Andolo
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 44 minutes
                5h 44m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.