Reputation: 151
I would like to know if I can pass a base64 encrypted , encoded string in the URL. Could you please advice on this !
When I wrote this in Spring , below is the controller I wrote :
@Controller
@RequestMapping("/sampleapp")
public class ABC {
@RequestMapping("/{encryptedText}/{fileName}")
public bye[] streamContent(@PathVariable String encryptedText, @PathVariable String fileName){
return ;
}
}
Upvotes: 2
Views: 3821
Reputation: 5175
Yes you can, as long as as the base64 string is URL Safe, this is replacing the non safe characters: '+', '/'
and removing the padding character =
of the Base64 string.
I'd recommend you this apache Apache commons-codec library that you can use to encode/decode Base64 URL Strings.
Hope this helps,
Jose Luis
Upvotes: 1