This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/14641] New: URL doesn't insert a "/" in the GET request


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

public class URLT {


//GET  HTTP/1.1
//Content-type: application/x-www-form-urlencoded
//accept: */*
//Host: www.gnu.org
//user-agent: gnu-libgcj/3.4.0 20040131 (prerelease)
//Connection: Close

// notice the missing "/" in the GET request

  public static void main(String[] argv) {

    URL url = null;
    try {
      url = new URL("http://www.gnu.org";);
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }

    try {
      BufferedReader b = new BufferedReader(new InputStreamReader
(url.openStream()));
      StringBuffer sb = new StringBuffer();
      String string;
      while ((string = b.readLine()) != null)
        sb.append(string);
      b.close();

      System.out.println(sb.toString());

    } catch (IOException e) {
    }
  }
}

-- 
           Summary: URL doesn't insert a "/" in the GET request
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ovidr at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14641


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]