Skip to content

API リクエスト時に UserAgent を設定した #15

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

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

atm-snag2
Copy link
Contributor

What

  • QiitaCLI からのリクエストであることがわかるように,userAgent を設定した
  • その他
    • バージョンを package.json から取得できるようにした

How

Why

Refs

@atm-snag2 atm-snag2 self-assigned this Jul 5, 2023
@atm-snag2 atm-snag2 requested review from a team, kyntk and ohakutsu and removed request for a team July 5, 2023 03:50
@kyntk kyntk removed request for kyntk and ohakutsu July 5, 2023 05:22
@atm-snag2 atm-snag2 requested a review from ohakutsu July 5, 2023 05:22
ohakutsu
ohakutsu previously approved these changes Jul 5, 2023
Copy link
Member

@ohakutsu ohakutsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 18 to 21
const { token } = options || { token: undefined };
const { accessToken } =
token === undefined ? await config.getCredential() : { accessToken: token };
return accessToken;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

短く書けそうです

Suggested change
const { token } = options || { token: undefined };
const { accessToken } =
token === undefined ? await config.getCredential() : { accessToken: token };
return accessToken;
return options?.token ?? (await config.getCredential()).accessToken;

@atm-snag2 atm-snag2 requested a review from ohakutsu July 5, 2023 06:29
Copy link
Contributor

@kyntk kyntk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ohakutsu ohakutsu merged commit c99ed61 into main Jul 7, 2023
@ohakutsu ohakutsu deleted the change-user-agent branch July 7, 2023 03:55
@ohakutsu ohakutsu mentioned this pull request Jul 7, 2023
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 this pull request may close these issues.

3 participants