summaryrefslogtreecommitdiff
path: root/test/simple/test-http-head-request.js
Commit message (Collapse)AuthorAgeFilesLines
* test: split test in parallel/sequentialFedor Indutny2014-12-171-69/+0
| | | | | | Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139
* http: do not send `0\r\n\r\n` in TE HEAD responsesFedor Indutny2014-09-161-23/+35
| | | | | | | | | | | | | | | | | | | When replying to a HEAD request, do not attempt to send the trailers and EOF sequence (`0\r\n\r\n`). The HEAD request MUST not have body. Quote from RFC: The presence of a message body in a response depends on both the request method to which it is responding and the response status code (Section 3.1.2). Responses to the HEAD request method (Section 4.3.2 of [RFC7231]) never include a message body because the associated response header fields (e.g., Transfer-Encoding, Content-Length, etc.), if present, indicate only what their values would have been if the request method had been GET (Section 4.3.1 of [RFC7231]). fix #8361 Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
* stream: Don't emit 'end' unless read() calledisaacs2013-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves the problem of calling `readable.pipe(writable)` after the readable stream has already emitted 'end', as often is the case when writing simple HTTP proxies. The spirit of streams2 is that things will work properly, even if you don't set them up right away on the first tick. This approach breaks down, however, because pipe()ing from an ended readable will just do nothing. No more data will ever arrive, and the writable will hang open forever never being ended. However, that does not solve the case of adding a `on('end')` listener after the stream has received the EOF chunk, if it was the first chunk received (and thus, length was 0, and 'end' got emitted). So, with this, we defer the 'end' event emission until the read() function is called. Also, in pipe(), if the source has emitted 'end' already, we call the cleanup/onend function on nextTick. Piping from an already-ended stream is thus the same as piping from a stream that is in the process of ending. Updates many tests that were relying on 'end' coming immediately, even though they never read() from the req. Fix #4942
* test: replace .addListener() calls with .on()Ben Noordhuis2011-10-151-2/+2
|
* Fixed a lot of jslint errors.Colton Baker2011-10-051-2/+2
| | | | Fixes #1831
* test: refactored http test.koichik2011-08-161-4/+6
| | | | | | | Many http tests had used legacy http.Client. This refactored it to use modern API. Fixes #1528.
* Update copyright headersRyan Dahl2011-03-141-0/+21
|
* GJSLint all tests, only 3 long lines left in test-url.jsOleg Efimov2010-12-051-8/+8
| | | | | | test/simple/test-url.js:31:(0110) Line too long (82 characters). test/simple/test-url.js:39:(0110) Line too long (85 characters). test/simple/test-url.js:40:(0110) Line too long (92 characters).
* Fix global leaksRyan Dahl2010-12-041-8/+6
|
* Soft migration of sys -> util, Removal of deprecated utils module.Micheil Smith2010-10-111-1/+1
|
* Update tests to work with module contextsRyan Dahl2010-07-151-6/+7
|
* Don't encourage strange ideas about req race conditionsRyan Dahl2010-06-201-1/+1
|
* Soft deprecation of 'listening' event.Ryan Dahl2010-06-151-2/+1
| | | | Add callback param to listen() instead
* Fix issue 89, parsing responses to HEAD requestsRyan Dahl2010-05-251-0/+35
| | | | Test from Mark Hansen (mark at markhansen.co.nz)
* Move two broken tests to disabled folderRyan Dahl2010-04-151-39/+0
|
* Add failing test for HEAD requestsRyan Dahl2010-04-111-0/+39
Needs to be fixed for 0.2.