Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1005165 - hideCredentials - hide credentials from URL for printing.

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2451L/16K).

static S hideCredentials(URL url) { ret url == null ? null : hideCredentials(str(url)); }

static S hideCredentials(S url) {
  try {
    if (startsWithOneOf(url, "http://", "https://") && isAGIBlueDomain(hostNameFromURL(url))) ret url;
  } catch e {
    print("HideCredentials", e);
  }
  ret url.replaceAll("([&?])(_pass|key|cookie)=[^&\\s\"]*", "$1$2=<hidden>");
}

static S hideCredentials(O o) {
  ret hideCredentials(str(o));
}

download  show line numbers  debug dex   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1005165
Snippet name: hideCredentials - hide credentials from URL for printing.
Eternal ID of this version: #1005165/14
Text MD5: 70f781eca2b1eb137f40a950d31e632c
Transpilation MD5: ff99c3b20dd7ccceac15120f5093f4a7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-05 14:24:06
Source code size: 445 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 354 / 701
Version history: 13 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1005165 & http://1005165.tinybrain.de