Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@stc1988
Copy link
Contributor

@stc1988 stc1988 commented Jan 27, 2026

Currently, the API KEY can only be specified from the config, but I have added an option to allow users to use their own specified values. There is no impact on the existing application code.

Also, when I checked the behavior of this update, I found several issues, so I fixed them. Please see the commit for details.

Comment on lines +104 to +105
this.headers.delete("content-length");
this.headers.delete("Content-Type");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious about this change. I think I can see why you might need to clear content-length but isn't Content-Type always "application/json"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, the connection error was resolved simply by clearing the content-length. On the other hand, Content-Type is not considered required.
I don’t think it will cause an error in the future by being considered unnecessary, but I cleared the non-required items

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for the explanation. We should be consistent in how we communicate with a esrvice.

With this change, we set the Content-Type for some requests and not others. If you are confident the Content-Type is optional, then we should remove it from the headers altogether - then there's no need to delete it. Still, my experience is that it is safer to explicitly set the Content-Type, but maybe that's no longer the case.

Copy link
Contributor Author

@stc1988 stc1988 Jan 29, 2026

Choose a reason for hiding this comment

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

I reviewed the code again, and with this change there is no modification to the headers used for Web API requests.
The update only removes headers from the WebSocket connection request.

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