Socket
Socket
Sign inDemoInstall

urllib

Package Overview
Dependencies
Maintainers
1
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urllib - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

7

History.md
0.3.2 / 2012-11-08
==================
* fixed #4 support urllib.request(options, args, callback)
* fixed usage demo bug
* fixed readme
0.3.1 / 2012-11-05

@@ -3,0 +10,0 @@ ==================

18

lib/urllib.js

@@ -41,3 +41,3 @@ /**

*
* @param {String} url
* @param {String|Object} url
* @param {Object} [args], optional

@@ -67,4 +67,4 @@ * - {Object} [data]: request data, will auto be query stringify.

args.timeout = args.timeout || exports.TIMEOUT;
args.type = (args.type || args.method || 'GET').toUpperCase();
var info = urlutil.parse(url);
var info = typeof url === 'string' ? urlutil.parse(url) : url;
args.type = (args.type || args.method || info.method || 'GET').toUpperCase();
var method = args.type;

@@ -82,3 +82,3 @@ var port = info.port || 80;

var options = {
host: info.hostname,
host: info.hostname || info.host || 'localhost',
path: info.path || '/',

@@ -90,8 +90,8 @@ method: method,

};
if (info.auth) {
options.auth = info.auth;
var auth = args.auth || info.auth;
if (auth) {
options.auth = auth;
}
if (args.auth) {
options.auth = args.auth;
}
var body = args.content || args.data;

@@ -98,0 +98,0 @@ if (!args.content) {

{
"name": "urllib",
"version": "0.3.1",
"version": "0.3.2",
"description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.",

@@ -5,0 +5,0 @@ "keywords": [ "urllib", "http", "urlopen", "curl", "wget" ],

@@ -27,3 +27,3 @@ # urllib [![Build Status](https://secure.travis-ci.org/TBEDP/urllib.png?branch=master)](http://travis-ci.org/TBEDP/urllib)

### Upload file with `[formstream](https://github.com/fengmk2/formstream)`
### Upload file with [`formstream`](https://github.com/fengmk2/formstream)

@@ -48,3 +48,2 @@ ```js

data.should.include('Content-Disposition: form-data; name="file"; filename="urllib.test.js"');
done();
});

@@ -51,0 +50,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc