You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes
The constructor of line-bot-sdk-nodejs client modifies the given config,
which should ideally behave immutably. Reusing the config as is can lead
to unexpected behavior(see below sample `#2`). This change ensures that
the config is not unintentionally overwritten.
## How to reproduce this
(normal)
```ts
// #1 (it works, but `config`'s baseURL is updated expectedly)
const config = {
channelAccessToken: "token-token",
};
const blobClient = new messagingApi.MessagingApiBlobClient(config);
// config.baseURL -> https://api-data.line.me (Unexpected, but it works)
```
(this issue)
Executing the following code does not set `api.line-data.me`. A
workaround is to clone the config, but this is not convenient and
debugging can be troublesome.
```ts
// #2 (blob doesn't work, because the first unexpected update blocks blob client uses expected baseURL)
const config = {
channelAccessToken: "token-token",
};
const client = new messagingApi.MessagingApiClient(config);
// config.baseURL -> https://api.line.me
const blobClient = new messagingApi.MessagingApiBlobClient(config);
// config.baseURL -> https://api.line.me, not https://api-data.line.me (Unexpected, and it won't work)
```
0 commit comments