Skip to content

Add user-agent headers to HTTP requests to satisfy new Canvas requirementΒ #99

@chrispittman

Description

@chrispittman

In mid-January, the Canvas LMS will stop accepting API requests or LTI 1.1 grade-passback requests that don't include a User-Agent header. (details at https://community.canvaslms.com/t5/Canvas-LMS-Blog/Enforcing-User-Agent-Header-for-Canvas-API-Requests/ba-p/658205)

Neither of the current ClientInterface implementations include this header... adding a manual user-agent seems pretty straightforward, though. Here's two fixes that test well for me:

CurlClient->send() : add curl_setopt($ch, CURLOPT_USERAGENT, 'ceLTIc/LTI PHP Library');

StreamClient->send(): add $message->requestHeaders[] = 'User-Agent: ceLTIc/LTI PHP Library';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions