Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 41715b1c50.
PrevUpHomeNext
static_url::remove_password

(Inherited from url_base)

Remove the password.

Synopsis
url_base&
remove_password();
Description

This function removes the password from the userinfo if a password exists. If there is no userinfo or no authority, the call has no effect.

Remarks

The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated.

Example
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
Postconditions
this->has_password() == false && this->encoded_password().empty() == true
Complexity

Linear in this->size().

Exception Safety

Throws nothing.

BNF
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
Specification
See Also

set_encoded_password, set_encoded_user, set_password, set_user.


PrevUpHomeNext