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

Improved the X-Redirect-By header when debugging is on

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull 3.10 Branch:
      MDL-69779-better-x-redirect-by-MOODLE_310_STABLE
    • Pull Master Branch:
      MDL-69779-better-x-redirect-by
    • Testing Instructions:
      Hide
      1. Start with debugging off
      2. Open the browser dev tools, access to the network tab and check the "Preserve log" box (Chrome)
      3. Login to your Moodle site (it will perform a redirect)
      4. Looking at the "Network" tab in your browser, find for a page with 303 status code, click over the content in the "Name" column and confirm you can see a simple 'X-Redirect-By: Moodle' in the "Response header" section
      5. Turn debugging up to develop
      6. Repeat and confirm you can now see the path and line number of the code that triggered the redirect eg: X-Redirect-By: Moodle /index.php:73
      Show
      Start with debugging off Open the browser dev tools, access to the network tab and check the "Preserve log" box (Chrome) Login to your Moodle site (it will perform a redirect) Looking at the "Network" tab in your browser, find for a page with 303 status code, click over the content in the "Name" column and  confirm you can see a simple 'X-Redirect-By: Moodle' in the "Response header" section Turn debugging up to develop Repeat and confirm you can now see the path and line number of the code that triggered the redirect eg: X-Redirect-By: Moodle /index.php:73

      Description

      Just improves MDL-67403 if the debug level is set to developer by adding not only the fact that Moodle did the redirect (as opposed to say nginx or a load balancer elsewhere in the stack) but also the exact file and line that triggered the redirect. This can help immensely in environments where you cannot live debug but have to track down redirect loops or multi redirect hops that could be simplified.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              brendanheywood Brendan Heywood
              Peer reviewer:
              Peter Burnett Peter Burnett
              Integrator:
              Víctor Déniz Falcón Víctor Déniz Falcón
              Tester:
              Anna Carissa Sadia Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/20

                  Time Tracking

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