Skip to content

Conversation

@Yang-33
Copy link
Owner

@Yang-33 Yang-33 commented Dec 28, 2023

bodyに入れれば十分なので、headerを消す

@Yang-33 Yang-33 force-pushed the autheorization-header-is-not-required-in-module-attach branch from 539e200 to db3d9f5 Compare December 28, 2023 15:16
Yang-33 added a commit that referenced this pull request May 17, 2024
## 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)
```
@Yang-33 Yang-33 force-pushed the master branch 5 times, most recently from 41cb076 to ae682ff Compare November 26, 2024 13:42
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.

2 participants