From be230423155145a5e3c1df170e410deb10c51177 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 25 May 2012 06:22:07 +0800 Subject: [PATCH] tests/soup.js --- tests/soup.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/soup.js b/tests/soup.js index fbc5632f..4fcaf4b8 100644 --- a/tests/soup.js +++ b/tests/soup.js @@ -8,7 +8,6 @@ GLib = imports.gi.GLib; var session = new Soup.SessionSync(); File = imports['../File.js'].File; -Netrc.load(); // Soup.URI is a struct. var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php/Roo/Events"); @@ -24,12 +23,12 @@ msg.set_request('application/x-www-form-urlencoded', Soup.MemoryUse.COPY, buftxt var auth = new Soup.Auth.c_new(Soup.AuthBasic.type, msg, "Basic realm=\"Test\""); -print(auth); -print(auth.authenticate); -var authvals = authdata['git.roojs.com']; + +var authvals = Netrc.forHost('git.roojs.com'); + auth.authenticate(authvals.login ,authvals.password); var authmsg = auth.get_authorization(msg); -print(authmsg); +//print(authmsg); msg.request_headers.append('Authorization', authmsg) //request.headers_append... -- 2.39.2