Revert "Reject ftp URLConnection containing /r/n in user info."
This reverts commit 6e0600543f9a81bc94b8d9d25b13456798c7fbec.
It's being replaced by working openjdk based changeset.
Test: FtpURLConnectionTest
Bug: 35784677
Change-Id: If4b13fd7b01733ec3cbd9a388c39c1eee9a0bc52
Merged-In: I192a19133baf654b5f8d2280afb00eb567cba16a
(cherry picked from commit f09d34c9c7ceb622161d2db900db381b3c256f17)
diff --git a/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
index fd96343..e2b7fa1 100755
--- a/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
+++ b/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
@@ -184,12 +184,6 @@
}
if (userInfo != null) { // get the user and password
- // Android-changed: Added a test for CR/LF presence in the userInfo
- if (userInfo.indexOf("\r") != -1 || userInfo.indexOf("\n") != -1) {
- throw new IOException("<CR> and/or <LF> characters in username and password are"
- + " not permitted");
- }
-
int delimiter = userInfo.indexOf(':');
if (delimiter == -1) {
user = ParseUtil.decode(userInfo);