-1

When I telnet my server it is getting connected, however after telnet connection if I request for GET /, it is not giving any response. But, after telnet connection if I request for GET / HTTP/1.1, it is giving me response. May I know this is a firewall issue as Im not getting response for GET / but getting for GET / HTTP/1.1

5
  • GET / is not a properly formed http request.
    – user9517
    Sep 27, 2016 at 19:46
  • @lain not sure why GET / is working for the other 3
    – balaji
    Sep 27, 2016 at 21:20
  • someone down voted it :(, not sure why as it is an issue that im facing currently
    – balaji
    Sep 28, 2016 at 5:54
  • OK, so here's the problem, your question is pretty crappy. You've chucked some stuff at the internet and screamed HALP! in the hope that someone will take pity on you and hold your hand through a series of reverse Q&A to help you troubleshoot your problem. You have not provided anywhere near sufficient information for anyone to answer your question. You need tech support and that is not what SF provides.
    – user9517
    Sep 28, 2016 at 6:13
  • @lain ok got it
    – balaji
    Sep 28, 2016 at 7:34

2 Answers 2

3

The original HTTP 0.9 protocol allowed the use of a single GET without specifying either protocol of hostname. For example:

GET /index.html

To use HTTP 1.0, you need to specify the protocol, however the Host header field had yet to be defined by RFC so is not required. Example HTTP 1.0 request:

GET /index.html HTTP/1.0

For HTTP 1.1, you need to specify the protocol AND Host header as per RFC 2616:

GET /index.html HTTP/1.1
Host: www.example.com

It is possible that your webservers have support for different versions of the HTTP protocol and therefore some accept the HTTP 0.9 style request whilst other, newer servers, don't.

4
  • Hi Mark, is "GET /index.html" same as "GET /", thanks for your answer :)
    – balaji
    Sep 28, 2016 at 8:37
  • It depends. GET / will return whichever file has been set as root on the server, however this doesn't necessarily have to be index.html, but it is quite common. Sep 28, 2016 at 11:41
  • Also, I have done curl --head for all the severs , somehow I got 1.1 as HTTP protocol version.
    – balaji
    Sep 28, 2016 at 12:10
  • Curl (and most other CLI or GUI based web clients) uses HTTP 1.1 unless you tell it otherwise. The -0 flag can be used to send the request using HTTP 1.0 (source) Sep 28, 2016 at 12:35
1

While simple web servers may respond to "GET /", it is not a proper/true/compliant request, so either a firewall or even the web server is not parsing and processing the request.

See https://www.rfc-editor.org/rfc/rfc2068#section-5.1

4
  • Hi Slass, thanks for your answer :), we have 3 more webservers for which this "GET /" is working not sure not for a particular webserver it is not working
    – balaji
    Sep 27, 2016 at 20:33
  • Just use "GET / HTTP/1.1" for all the servers, it should work for all of them.
    – slass100
    Sep 27, 2016 at 20:38
  • "GET /HTTP/1.1" is not working for the other 2 servers
    – balaji
    Sep 27, 2016 at 20:57
  • I assume you are trying with "GET<space>/<space>HTTP/1.1". Looks like a <space> is missing in the comment above. Maybe test with "wget" or "curl" and look at how these command-line apps format the request.
    – slass100
    Sep 27, 2016 at 21:22

Not the answer you're looking for? Browse other questions tagged .