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

Unable to set header "Authorization: Sign ..." when using HttpClient #4687

Closed
karokonco opened this issue Jan 5, 2021 · 2 comments
Closed
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@karokonco
Copy link

karokonco commented Jan 5, 2021

I

----------------------------- Remove above -----------------------------

Hardware:

Board: nodemcu-32s
Core Installation version: 1.0.4
IDE name: Arduino IDE
Flash Frequency: 240Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10

Description:

Unable to set header "Authorization: Sign ..." when using HttpClient

When using HTTPClient libraries, looking at the source code:

HttpClient.cpp:

.......

void HTTPClient::addHeader(const String& name, const String& value, bool first, bool replace)
{
// not allow set of Header handled by code
if(!name.equalsIgnoreCase(F("Connection")) &&
!name.equalsIgnoreCase(F("User-Agent")) &&
!name.equalsIgnoreCase(F("Host")) &&
!(name.equalsIgnoreCase(F("Authorization")) && _base64Authorization.length())){

and look at how the code do it as:

if(_base64Authorization.length()) {
_base64Authorization.replace("\n", "");
header += F("Authorization: Basic ");
header += _base64Authorization;
header += "\r\n";
}

Please add additional way or remove this constraint in order to set header "Authorization: Sign UriqJfnonwY2TGGJkYcd0q0lxzcTiHZzrA8bPELb0qE=.

@stale
Copy link

stale bot commented Jun 23, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jun 23, 2021
@stale
Copy link

stale bot commented Jul 8, 2021

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

1 participant