Skip to content

Commit

Permalink
HttpClient's user agent includes its corresponding Ringo version
Browse files Browse the repository at this point in the history
  • Loading branch information
botic committed Nov 22, 2017
1 parent c89d45b commit 1a055d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/ringo/httpclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var log = require("ringo/logging").getLogger(module.id);

export("request", "get", "post", "put", "del", "TextPart", "BinaryPart");

const VERSION = "0.1";
const VERSION = require("ringo/engine").version.join(".");
const CRLF = "\r\n";
const BOUNDARY_CHARS = "-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

Expand Down
6 changes: 3 additions & 3 deletions test/ringo/httpclient_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ exports.tearDown = function() {
* test basic get
*/
exports.testBasic = function() {
var text = "<h1>This is the Response Text</h1>";
const text = "This is the Response Text";

getResponse = function(req) {
return response.html(text);
return response.html(text + " - " + req.headers["user-agent"]);
};

var exchange = request({
url: baseUri
});

assert.strictEqual(exchange.content, text);
assert.strictEqual(exchange.content, text + " - " + "RingoJS HttpClient " + require("ringo/engine").version.join("."));
};

exports.testNullContent = function() {
Expand Down

0 comments on commit 1a055d5

Please sign in to comment.