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

MOD_LTI: Delete does not work without Content-Type

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Your site should be publicly available. (e.g. ngrok)

      1. Install https://github.com/claudevervoort/moodleltiecho - zip attached into mod/lti/service/echoservice
        1. verify the plugin is listed as successfully installed
      2. Go to Site administration > Plugins > Activity modules > External tool > Manage tools
      3. Add http://lti.tools/test/tp.php
        1. ask for ALL capabilities and services
        2. verify Services has tcp:Echo.Item and other capabilities has echo.url are proposed and selected options
        3. rename the tool as LTI Test Tools with Echo
        4. Activate LTI Test Tools with Echo
      4. On a course, add an external tool
        1. name: Link with Echo URL
        2. Select the tool LTI Test Tools with Echo
        3. add custom parameter: echo_url=$echo.url
        4. save
      5. Open activity 'Link with Echo URL'
        1. Copy the echo url shown under raw post parameters.
      6. Use REST client to issue a Delete request (with OAuth payload using key and secret)
        1. To do this I used REST Client on Firefox
        2. I pasted the Echo URL in the URL box
        3. Selected DELETE as the method
        4. Created an OAuth header using the Authentication drop down menu
          1. Use the oauth_consumer_key as the key
          2. custom_secret in raw parameters as the secret
        5. Pressed SEND
      7. You should get response code: 204

      See video: http://claudeonthe.net/moodle/MDL-60007-steps.mp4

      Show
      Your site should be publicly available. (e.g. ngrok) Install https://github.com/claudevervoort/moodleltiecho - zip attached into mod/lti/service/echoservice verify the plugin is listed as successfully installed Go to Site administration > Plugins > Activity modules > External tool > Manage tools Add http://lti.tools/test/tp.php ask for ALL capabilities and services verify Services has tcp:Echo.Item and other capabilities has echo.url are proposed and selected options rename the tool as LTI Test Tools with Echo Activate LTI Test Tools with Echo On a course, add an external tool name: Link with Echo URL Select the tool LTI Test Tools with Echo add custom parameter: echo_url=$echo.url save Open activity 'Link with Echo URL' Copy the echo url shown under raw post parameters. Use REST client to issue a Delete request (with OAuth payload using key and secret) To do this I used REST Client on Firefox I pasted the Echo URL in the URL box Selected DELETE as the method Created an OAuth header using the Authentication drop down menu Use the oauth_consumer_key as the key custom_secret in raw parameters as the secret Pressed SEND You should get response code: 204 See video: http://claudeonthe.net/moodle/MDL-60007-steps.mp4
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-60007

      Description

      A DELETE operation does not contain any data in the body, and thus should not need to have a Content-Type header since no data is sent. However the current LTI Service routing stack will consider a non GET incoming request incorrect if it does not contain a Content-Type.

      This was discovered while verifying DELETE on Gradebook Service using IMS validator and might have been a dormant issue since there is no DELETE on pre-existing LTI services.

      Without this fix, DELETE operations on resources exposed by the LTI services will not be supported unless the caller explicitly sets the Content-Type header to the type of data being deleted.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17