pylti / lti

Learning Tools Interoperability for Python
Other
78 stars 45 forks source link

Params with an empty cause malformed signatures #46

Closed tim-schilling closed 7 years ago

tim-schilling commented 7 years ago

When a param is supplied to ToolConsumer and it has an empty string for a value, it is used to generate the signature on the request via generate_launch_request, however it is not included in generate_launch_data. This causes problems when a server attempts to validate the signature because it won't have that additional parameter resulting in a completely different signature.

tim-schilling commented 7 years ago

This is being caused by lti.tool_outbound.ToolOutbound.generate_launch_data's call to parse_qs. In py3, urlparse.parse.parse_qs will remove any parameter that has an empty string for a value when keep_blank_values is set to False which is the default.