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
|
* @param auth const char * base64
|
||||||
*/
|
*/
|
||||||
void HTTPClient::setAuthorization(const char * auth)
|
void HTTPClient::setAuthorization(const char * auth)
|
||||||
{
|
{
|
||||||
if (auth) {
|
if (auth) {
|
||||||
_base64Authorization = auth;
|
setAuthorization(String(auth));
|
||||||
_base64Authorization.replace(String('\n'), emptyString);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* set the timeout for the TCP connection
|
||||||
* @param timeout unsigned int
|
* @param timeout unsigned int
|
||||||
|
@ -176,6 +176,7 @@ public:
|
|||||||
void setUserAgent(const String& userAgent);
|
void setUserAgent(const String& userAgent);
|
||||||
void setAuthorization(const char * user, const char * password);
|
void setAuthorization(const char * user, const char * password);
|
||||||
void setAuthorization(const char * auth);
|
void setAuthorization(const char * auth);
|
||||||
|
void setAuthorization(String auth);
|
||||||
void setTimeout(uint16_t timeout);
|
void setTimeout(uint16_t timeout);
|
||||||
|
|
||||||
// Redirections
|
// Redirections
|
||||||
|
Loading…
x
Reference in New Issue
Block a user