Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS] [DPG] BearerAuth generates lower case "bearer <key>" #2572

Closed
glharper opened this issue Jun 12, 2024 · 1 comment · Fixed by #2576
Closed

[TS] [DPG] BearerAuth generates lower case "bearer <key>" #2572

glharper opened this issue Jun 12, 2024 · 1 comment · Fixed by #2576
Assignees

Comments

@glharper
Copy link
Member

The BearerAuth keyword in TypeSpec seems to generate the following client code in TS:

  if (isKeyCredential(credentials)) {
    client.pipeline.addPolicy({
      name: "customKeyCredentialPolicy",
      async sendRequest(request, next) {
        request.headers.set("Authorization", "bearer " + credentials.key);
        return next(request);
      },
    });
  }

That fifth line should be (note capitalized Bearer): request.headers.set("Authorization", "Bearer " + credentials.key);

@timovv
Copy link
Member

timovv commented Jun 12, 2024

Related: #2109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants