Method Case Causes 400 BAD REQUEST Error

Created on 23 June 2021, over 3 years ago
Updated 27 July 2023, about 1 year ago

Problem/Motivation

When using the Canvas API module (7.x-2.x version), making a request (e.g.: list users as GET) fails with a 400 BAD REQUEST error response. Attempting the same response using Postman worked, however. Digging into the response, it seems that thre request made via the module was intercepted by AWS (Server in response was "awselb") while the Server response in Postman was "Apache" with a lot more response headers than found in the module request. After trying several different request headers with no luck, on a whim I changed the case of the method in the Canvas object to uppercase (i.e.: "GET" instead of "get") and it worked!

My guess is that something is locked down at a certain level on the Canvas side to allow only requests with uppercase verbs through.

Steps to reproduce

Make an API request via the 7.x-2.x branch module; compare to similar results in Postman or Curl.

Proposed resolution

Change lowercase methods in Canvas object to uppercase - patch to follow.

Remaining tasks

Post a patch.

User interface changes

None.

API changes

None.

Data model changes

See patch.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tkiehne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024