Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8028908 | port-stage-ppc-aix | Xueming Shen | P3 | Resolved | Fixed | master |
Description
A DESCRIPTION OF THE REQUEST :
java.util.Base64.getUrlEncoder() should not apply padding at the end of encoding.
Alternatively, padding control should be exposed as an option. There are several variants of base64 encoding where padding should be omitted: http://en.wikipedia.org/wiki/Base64#Variants_summary_table
JUSTIFICATION :
This is a fairly common scenario. In base64url encoding padding is usually omitted. It is certainly optional and if present should actually be URL encoded as %3D.
Thus, the default behavior of Base64.getUrlEncoder should be changed to omit padding.
CUSTOMER SUBMITTED WORKAROUND :
One could keep using the various libraries available that support this properly (eg. Guava, Apache Commons, etc), but this defeats the purpose of having this functionality in the JDK.
java.util.Base64.getUrlEncoder() should not apply padding at the end of encoding.
Alternatively, padding control should be exposed as an option. There are several variants of base64 encoding where padding should be omitted: http://en.wikipedia.org/wiki/Base64#Variants_summary_table
JUSTIFICATION :
This is a fairly common scenario. In base64url encoding padding is usually omitted. It is certainly optional and if present should actually be URL encoded as %3D.
Thus, the default behavior of Base64.getUrlEncoder should be changed to omit padding.
CUSTOMER SUBMITTED WORKAROUND :
One could keep using the various libraries available that support this properly (eg. Guava, Apache Commons, etc), but this defeats the purpose of having this functionality in the JDK.
Attachments
Issue Links
- backported by
-
JDK-8028908 java.util.Base64 urlEncoder should omit padding
- Resolved