--- loncom/lti/ltipassback.pm 2018/08/14 21:42:36 1.6 +++ loncom/lti/ltipassback.pm 2018/08/14 22:00:43 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # LTI Consumer Module to receive grades passed back by Provider # -# $Id: ltipassback.pm,v 1.6 2018/08/14 21:42:36 raeburn Exp $ +# $Id: ltipassback.pm,v 1.7 2018/08/14 22:00:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -188,14 +188,16 @@ sub handler { # Verify XML in request body has not been tampered with # - my $bodyhash = Digest::SHA::sha1_base64($xmlbody); - while (length($bodyhash) % 4) { - $bodyhash .= '='; - } - unless ($bodyhash eq $params->{oauth_body_hash}) { - $errors{16} = 1; - &invalid_request($r,$params,\%errors); - return OK; + if ($content_type eq 'application/xml') { + my $bodyhash = Digest::SHA::sha1_base64($xmlbody); + while (length($bodyhash) % 4) { + $bodyhash .= '='; + } + unless ($bodyhash eq $params->{oauth_body_hash}) { + $errors{16} = 1; + &invalid_request($r,$params,\%errors); + return OK; + } } #