mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Allow control over HTTPClient authorization String allocation (#8225)
This commit is contained in:
parent
65db3aec72
commit
058ce7c08e
@ -276,17 +276,26 @@ void HTTPClient::setAuthorization(const char * user, const char * password)
|
||||
}
|
||||
|
||||
/**
|
||||
* set the Authorizatio for the http request
|
||||
* set the Authorization for the http request
|
||||
* @param auth const char * base64
|
||||
*/
|
||||
void HTTPClient::setAuthorization(const char * auth)
|
||||
{
|
||||
if (auth) {
|
||||
_base64Authorization = auth;
|
||||
_base64Authorization.replace(String('\n'), emptyString);
|
||||
setAuthorization(String(auth));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set the Authorization for the http request
|
||||
* @param auth String base64
|
||||
*/
|
||||
void HTTPClient::setAuthorization(String auth)
|
||||
{
|
||||
_base64Authorization = std::move(auth);
|
||||
_base64Authorization.replace(String('\n'), emptyString);
|
||||
}
|
||||
|
||||
/**
|
||||
* set the timeout for the TCP connection
|
||||
* @param timeout unsigned int
|
||||
|
@ -176,6 +176,7 @@ public:
|
||||
void setUserAgent(const String& userAgent);
|
||||
void setAuthorization(const char * user, const char * password);
|
||||
void setAuthorization(const char * auth);
|
||||
void setAuthorization(String auth);
|
||||
void setTimeout(uint16_t timeout);
|
||||
|
||||
// Redirections
|
||||
|
Loading…
x
Reference in New Issue
Block a user