boost::urls::url_base::remove_password

Remove the password

Synopsis

Declared in <include/boost/url/url_base.hpp>

url_base&
remove_password() noexcept;

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.

NOTE

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

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

Linear in `this->size()`.

Throws nothing.

userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" )
  • 3.2.1. User Information (rfc3986)
  • See Also

    set_encoded_password , set_encoded_user , set_password , set_user .

    Created with MrDocs