Article View: pl.comp.www.server-side
Article #61470Re: Dziwne requesty
From: marek.horodyski
Date: Mon, 05 Aug 2013 23:24
Date: Mon, 05 Aug 2013 23:24
65 lines
3865 bytes
3865 bytes
W dniu niedziela, 4 sierpnia 2013 19:07:38 UTC+2 użytkownik Grzegorz Staniak napisał:
[...]
Witam ponownie.
Próbuję wykorzystać RFC. Miałem żądanie :
HEAD / HTTP/1.0
z adresu 194.87.34.22. Odpowiedziałem :
HTTP/1.0 501 Not Implemented
X-Powered-By: Harbour 3.2.0dev (r1304301343)/MinGW GNU C 4.6.1 (32-bit)
Cache-Control: no-cache
Server: homar.exe
Content-Type: text/html
Connection: Close
Keep-Alive: timeout=15
Date: Mon, 05 Aug 2013 08:54:25 GMT
Content-Length: 58
<html><body><h1>501 Not Implemented<br></h1></body></html>
Wg RFC powiniem odpowiedzieć :
HEAD
The HEAD method is identical to GET except that the server MUST NOT
return a message-body in the response. The metainformation contained
in the HTTP headers in response to a HEAD request SHOULD be identical
to the information sent in response to a GET request. This method can
be used for obtaining metainformation about the entity implied by the
request without transferring the entity-body itself. This method is
often used for testing hypertext links for validity, accessibility,
and recent modification.
The response to a HEAD request MAY be cacheable in the sense that the
information contained in the response MAY be used to update a
previously cached entity from that resource. If the new field values
indicate that the cached entity differs from the current entity (as
would be indicated by a change in Content-Length, Content-MD5, ETag
or Last-Modified), then the cache MUST treat the cache entry as
stale.
Problem w tym, że RFC nie podaje przykładowego żądania i poprawnej nań odpowiedzi, czego mi najbardziej brakuje. Wygląda, że odpowiedź powinna wyglądać :
HTTP/1.0 200 OK
X-Powered-By: Harbour 3.2.0dev (r1304301343)/MinGW GNU C 4.6.1 (32-bit)
Cache-Control: no-cache
Server: homar.exe
Content-Type: text/html
Connection: Close
Keep-Alive: timeout=15
Date: Mon, 05 Aug 2013 08:54:25 GMT
Content-Length: 0
albo przynajmniej tak mi się wydaje. Wobec tego dopisałem w kodzie metodę :
switch server[ as_http[ 10]]
case "HEAD"
exit // powinno pójść domyślne 200 w odpowiedzi i pusta strona - do TESTU!
case "GET"
case "POST"
I teraz ważne pytanie : JAK TO PRZETESTOWAĆ ?
Jak ze strony klienta wygenerować takie żądanie, abym mógł sprawdzić co serwer zrobi ?
Pozdrawiam,
Marek Horodyski
Technical Details
Message-ID:
<0e0fe4d4-c68f-4135-92b8-6b63cb90fc88@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.85.212.215.MISMATCH!g3no11481587wic.0!news-out.google.com!ed8ni4206wic.0!nntp.google.com!g3no11481580wic.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<fefdc1fb-b20b-4ba6-90ea-c39bbcb8ac5c@googlegroups.com> <slrnkvq56d.cj8.wytnij-to_gstaniak@inka.pl> <b460f36e-bc57-4312-9d3d-6209bf47ee8d@googlegroups.com> <slrnkvt1u7.tti.wytnij-to_gstaniak@inka.pl>Show Full Headers
Complete Article Headers
X-Received: by 10.180.182.230 with SMTP id eh6mr22035wic.3.1375745099330; Mon, 05 Aug 2013 16:24:59 -0700 (PDT) X-Received: by 10.49.99.65 with SMTP id eo1mr637997qeb.3.1375745098871; Mon, 05 Aug 2013 16:24:58 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.85.212.215.MISMATCH!g3no11481587wic.0!news-out.google.com!ed8ni4206wic.0!nntp.google.com!g3no11481580wic.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.www.server-side Date: Mon, 5 Aug 2013 16:24:58 -0700 (PDT) In-Reply-To: <slrnkvt1u7.tti.wytnij-to_gstaniak@inka.pl> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.77.33.3; posting-account=g0Ps8woAAAC_8HHKWHW9X9RXuJTnwqnC NNTP-Posting-Host: 89.77.33.3 References: <fefdc1fb-b20b-4ba6-90ea-c39bbcb8ac5c@googlegroups.com> <slrnkvq56d.cj8.wytnij-to_gstaniak@inka.pl> <b460f36e-bc57-4312-9d3d-6209bf47ee8d@googlegroups.com> <slrnkvt1u7.tti.wytnij-to_gstaniak@inka.pl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0e0fe4d4-c68f-4135-92b8-6b63cb90fc88@googlegroups.com> Subject: Re: Dziwne requesty From: marek.horodyski@gmail.com Injection-Date: Mon, 05 Aug 2013 23:24:59 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit