Commit Graph

101 Commits (b20c343a7aa772865f0cc4dd76d4c1984c38b33d)

Author SHA1 Message Date
Tim Caswell 3aca908db3 Document the changes to sys.inspect's API.
It now takes an optional showHidden argument that shows hidden/non-enumerable properties of objects.

Also cleanup the lib/sys.js file a bit.
2010-02-09 09:20:15 -08:00
Tim Caswell e33c66654a Rewrite sys.inspect to be more reliable and handle crazy edge cases. 2010-02-09 08:57:38 -08:00
isaacs 3adcdfc2e1 A rewrite of multipart library.
1. Support streaming in the simple case.  Put huge warnings around the
buffering API.
2. Support nested multipart messages.
3. Support various kinds of multipart messages, including all the various
absurdities of multipart email messages.
4. Error out on various invalid types of data that might come through.
5. Gracefully several edge cases that occur when the chunk size is smaller
than the boundary length, or cuts into the \r\n, etc.
6. Provide both positive and negative tests.
2010-02-08 14:03:06 -08:00
Aaron Heckmann 8f52142116 look for -1 instead of false returned from string.indexOf 2010-02-03 10:13:15 -08:00
Felix Geisendörfer ac2abe5b1e Bugfix: Handle Content-Type headers with charset
Some HTTP clients include a charset parameter in the Content-Type, e.g:

multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY

This patch makes the multipart parser more forgiving towards unexpected
information included in the Content-Type header.
2010-01-29 18:04:48 -08:00
Ryan Dahl 1bb52947e0 Forgot to include fix from HTTP client bug (30b0522) 2010-01-27 10:00:46 -08:00
Blaine Cook cd6397cc45 Add support for MX, TXT, and SRV records in DNS module. 2010-01-25 09:03:27 -08:00
Ryan Dahl c420c89dbd Make assert.AssertionError instance of Error 2010-01-24 14:39:32 -08:00
cloudhead 3669c75f4d removed inline require call for querystring 2010-01-24 14:25:31 -08:00
Michaeljohn Clement 4e16e386fe set default encoding in sendBody 2010-01-19 12:43:19 -08:00
Ryan Dahl 8abeffa9ea Add process.nextTick()
This is a replacement for the common hack:

  setTimeout(cb, 0);

It's much more efficient.
2010-01-18 10:32:36 -08:00
Ryan Dahl 70293a43c9 API: Move Promise and EventEmitter into 'events' module 2010-01-15 12:46:08 -08:00
Benjamin Thomas 947c577c0d Fix bug in the url module's url_parse method if 'parseQueryString' is true 2010-01-06 02:12:11 -08:00
Felix Geisendörfer f86c1783b7 Handle bad requests in simplified parser API 2010-01-05 22:37:51 +01:00
Felix Geisendörfer d9a81374b2 Throw exception for invalid multipart streams
When using the multipart parser with an regular http request, the
parser did not complain and just never finished.
2010-01-05 22:23:56 +01:00
elliottcable 52f088b966 Providing the option for a repl-printer other than sys.p 2010-01-05 00:14:03 -08:00
visionmedia a650138ebf Moved help msg to node-repl 2010-01-04 22:06:18 -08:00
isaacs 2b3d9e4ad0 Use "url" module instead of "uri" module in http.js.
Deprecate the URI module and remove tests for it.
- Rename "uri" to "url".
- Use the "url" module instead of the "uri" module.
- Remove the url parsing from http.js
- Update http.cat with the changed field names.
- Update tests for changes to http.js
- Update documentation for changes in http.js
2010-01-04 21:22:46 -08:00
isaacs 7ff04c1f86 Add URL and QueryString modules, and tests for each.
Also, make a slight change from original on url-module to put the
spacePattern into the function.  On closer inspection, it turns out that the
nonlocal-var cost is higher than the compiling-a-regexp cost.

Also, documentation.
2010-01-04 21:03:54 -08:00
Tim Caswell fd184ee2fa Rename "Dynamic Property" to "Getter/Setter" in sys.inspect. 2010-01-03 21:15:21 -08:00
Tim Caswell 6c68a9679b Fix inspect to not trigger dynamic properties
but to display them as special. Add unit tests to match
2010-01-02 18:18:01 -08:00
Tim Caswell 732c6f2036 Fix inspect for the special case of an Object that inherits from Array, but has other properties. 2009-12-31 09:57:29 -08:00
Ryan Dahl 0accebe583 Stack trace for asserts shouldn't include assert module 2009-12-29 20:15:05 +01:00
Ryan Dahl dd35637603 Fix assert.js code style 2009-12-29 20:10:59 +01:00
Michaeljohn Clement 3d24e119e0 don't chunk responses to HTTP/1.0 clients, even if they send Connection: Keep-Alive (e.g. wget) 2009-12-23 22:24:29 +01:00
Felix Geisendörfer 5de04dafc6 Do not pause request for multipart parsing
This is actually undesireable as it takes away control from the user who
may want to pause/resume to throttle the upload stream, or synchronize
it with disk flushing.

I actually ran into memory issues when trying to stream huge files to
disc as the file module was building up a huge action buffer. This can
now easily be avoided like this:

part.addListener('body', function(chunk) {
  req.pause();
  file.write(chunk).addCallback(function() {
    req.resume();
  });
}
2009-12-22 19:28:30 +01:00
isaacs 4dcdfaf929 Fix require("../blah") issues
Added some more tests, and refactored the uri and path modules to use the
same normalization logic, so that nothing is relying on flaky regexps.

http://groups.google.com/group/nodejs/browse_thread/thread/34779f8c10098c5e
http://groups.google.com/group/nodejs/browse_thread/thread/1aa0146b92582679#msg_9822c03998cb4064
2009-12-22 17:22:12 +01:00
isaacs 4526308560 Update to fix failing test. Rewrite of the resolveObject function, and some tweaks to format. 2009-12-18 19:02:27 +01:00
isaacs f65b36eec1 Use the new uri parser. 2009-12-18 19:02:16 +01:00
isaacs 4a615ddd9c Add credits, and a "decode" function. 2009-12-18 18:59:02 +01:00
isaacs 2f9722cca0 Pull in the uri.js from Narwhal and create tests, stripping out the cruft from a previous code-surgery. 2009-12-18 18:56:59 +01:00
visionmedia 501b4a54be Export STATUS_CODES
Express (my framework) uses them as a default
response body when non is present. Others
might use them for something as well.

Beats duplicating the list :D
2009-12-08 05:35:56 +01:00
Xavier Shay 756544fd28 sys.inspect prints out special chars correctly (\n, \u0001, etc...) 2009-12-07 10:05:18 +01:00
Christopher Lenz f8ba9c3bc9 Add http.Client.prototype.request()
Change the http.Client API so that it provides a single request() method
taking an optional parameter to specify the HTTP method (defaulting to
"GET"), instead of the five methods get(), head(), post(), del() and put().
2009-12-06 18:36:32 +01:00
Xavier Shay 34c02357ff sys.inspect is totally more awesome now
- No longer relies on JSON.stringify, so it can output nulls and functions
- Handles circular references better
- Has tests
2009-12-06 12:19:23 +01:00
Ryan Dahl 4d818f1fd3 Implement promises entirely in JS 2009-12-06 11:36:22 +01:00
Ryan Dahl 3414eab2f3 Refactor node_file.cc to not use Promises.
At the same time implement synchronous wrappers of the POSIX functions.
These will be undocumented until we settle on an API. Works like this

    // returns promise as before
    posix.mkdir("test").addCallback(function () {
      sys.puts("done");
    });

    // returns undefined, executed synchronously.
    posix.mkdirSync("test");
    sys.puts("done");

This refactoring is a step towards allowing promises to be implemented
purely in javascript.
2009-12-06 10:50:03 +01:00
Ryan Dahl 8141448fe5 Don't use promises internally in DNS module 2009-12-06 09:26:09 +01:00
Ryan Dahl c5d82380f4 Bugfix: Don't use chunked encoding for 1.0 requests.
http://groups.google.com/group/nodejs/browse_thread/thread/b2edb76691b1848c
2009-12-05 08:37:46 +01:00
Ryan Dahl 7538e70767 Expose versionMajor versionMinor to http messages 2009-12-05 07:55:24 +01:00
Karl Guertin 4f679fd8d0 Dependency free assert module with unit tests 2009-12-05 01:05:16 +01:00
Felix Geisendörfer 530328f12b CommonJS testing for node.js
Refactored test suite to use the assert module for testing rather than
mjsunit.
2009-12-05 01:05:16 +01:00
Michaeljohn Clement 485823f3e4 fixed HTTP duplicated header bug
added test case for HTTP duplicated header bug on keepalive
2009-12-05 00:56:22 +01:00
Rhys Jones 5b1a535cd8 Add HTTP client TLS support 2009-11-30 16:51:20 +01:00
jed a9ea21feb4 fixed check on header type, to check member instead of object. 2009-11-30 10:14:09 +01:00
Friedemann Altrock 1107a1bd1e sys.puts should not kill the process when giving it undefined 2009-11-28 20:56:47 +01:00
choonkeat 44d5f212fe Stat::Callback has 2 arguments for callback: current stat info and previous stat info
http://groups.google.com/group/nodejs/msg/f8e51a8e0c74bd85
2009-11-28 15:13:12 +01:00
Felix Geisendörfer 27fcae738a Reduce multipart memory footprint
Multipart parts kept the first chunk of data after their headers in
memory, even so that was no longer needed.
2009-11-22 15:09:55 +01:00
Rhys Jones b6dda61249 Initial TLS support 2009-11-22 04:03:53 +01:00
Felix Geisendörfer 528c449901 Multipart improvements
Multipart parts now have a name and filename property. Those are the
same as:

part.headers['content-disposition'].name
part.headers['content-disposition'].filename

This patch also updates and improves the docs for the multipart module.
2009-11-21 17:16:06 +01:00