Skip to content

HttpHeader are case sensitive when used in TestingFacade requests #653

@pxDot

Description

@pxDot

Using HttpHeader as controller param seems to be case sensitive but should be case insensitive.
Seems to only be an issue when sending requests via a TestingFacade app.

@http.POST('testcontrollerfunction')
async testControllerFunction(authorization: HttpHeader<string>): Promise<{ data: string }> {
  return new JSONResponse({ data: authorization });
}
test('header should not be case sensitive', async () => {
  const response = await testApp.request(HttpRequest.POST('/testcontrollerfunction').header('Authorization', 'teststring'));
  assert.strictEqual((await response.json).data, 'teststring'); // fails

  const response2 = await testApp.request(HttpRequest.POST('/testcontrollerfunction').header('authorization', 'teststring'));
  assert.strictEqual((await response.json).data, 'teststring'); // OK
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions