mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
Fixed issue with credentials that have special chars
This commit is contained in:
10
src/app/shared/utils/encode-decode.util.ts
Normal file
10
src/app/shared/utils/encode-decode.util.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* use this to make a Base64 encoded string URL friendly,
|
||||
* i.e. '+' and '/' are replaced with special percent-encoded hexadecimal sequences
|
||||
*
|
||||
* @param {String} str the encoded string
|
||||
* @returns {String} the URL friendly encoded String
|
||||
*/
|
||||
export function Base64EncodeUrl(str): string {
|
||||
return str.replace(/\+/g, '%2B').replace(/\//g, '%2F').replace(/\=/g, '%3D');
|
||||
}
|
Reference in New Issue
Block a user