Package org.openstreetmap.josm.tools
Class TextUtils
java.lang.Object
org.openstreetmap.josm.tools.TextUtils
Text/String utils.
- Since:
- 13978
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstripHeaders(Map<String, ?> headers) Remove privacy related values from output HTTP headers: those ofAuthorizationandProxy-Authorization, but for their scheme, so that the output still tells which kind of authentication was used, and those ofCookieandSet-Cookie.private static ObjectstripHeaderValue(Object value, boolean keepScheme) static StringRemove privacy related parts from output URL.static StringwrapLongUrl(String url) Inserts zero width space character (U+8203) after each slash/ampersand to wrap long URLs.
-
Field Details
-
STRIPPED
What private information is replaced with- See Also:
-
PRIVATE_PARAMETERS
The parameters which are private: API keys and tokens, and OAuth 2.0 client secrets, authorization codes and their verifiers, and passwords.codeis only matched as a whole name, so as not to strip e.g. a postcode. A value ends at white space too, so that what follows a URL in a log line is kept.
-
-
Constructor Details
-
TextUtils
private TextUtils()
-
-
Method Details
-
wrapLongUrl
Inserts zero width space character (U+8203) after each slash/ampersand to wrap long URLs.- Parameters:
url- URL- Returns:
- wrapped URL
- Since:
- 13978
-
stripUrl
Remove privacy related parts from output URL.This works for a form-encoded (
application/x-www-form-urlencoded) request body as well, which has the syntax of a query, such as an OAuth 2.0 token request with its client secret.- Parameters:
url- Unmodified URL- Returns:
- Stripped URL (privacy related issues removed)
- Since:
- 18652
-
stripHeaders
Remove privacy related values from output HTTP headers: those ofAuthorizationandProxy-Authorization, but for their scheme, so that the output still tells which kind of authentication was used, and those ofCookieandSet-Cookie.- Parameters:
headers- Unmodified headers, with a single value or a list of values for each- Returns:
- Stripped copy of the headers, in the same order (privacy related issues removed)
- Since:
- 19711
-
stripHeaderValue
-