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).

1  
static S hideCredentials(URL url) { ret url == null ? null : hideCredentials(str(url)); }
2  
3  
static S hideCredentials(S url) {
4  
  try {
5  
    if (startsWithOneOf(url, "http://", "https://") && isAGIBlueDomain(hostNameFromURL(url))) ret url;
6  
  } catch e {
7  
    print("HideCredentials", e);
8  
  }
9  
  ret url.replaceAll("([&?])(_pass|key|cookie)=[^&\\s\"]*", "$1$2=<hidden>");
10  
}
11  
12  
static S hideCredentials(O o) {
13  
  ret hideCredentials(str(o));
14  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, 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: 524 / 928
Version history: 13 change(s)
Referenced in: [show references]