Skip to content

Commit

Permalink
Merge pull request #20 from analog-nico/master
Browse files Browse the repository at this point in the history
  • Loading branch information
emerleite committed Jul 15, 2015
2 parents 4be97bd + 986a6ac commit 0fe9be3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -40,7 +40,7 @@ Usage
var unsecureUrl = gravatar.url('emerleite@gmail.com', {s: '100', r: 'x', d: 'retro'}, false);
//returns http://www.gravatar.com/avatar/93e9084aa289b7f1f5e4ab6716a56c3b?s=100&r=x&d=retro
var secureUrl = gravatar.url('emerleite@gmail.com', {s: '100', r: 'x', d: 'retro'}, true);
//returns https://secure.gravatar.com/avatar/93e9084aa289b7f1f5e4ab6716a56c3b?s=100&r=x&d=retro
//returns https://s.gravatar.com/avatar/93e9084aa289b7f1f5e4ab6716a56c3b?s=100&r=x&d=retro

Running tests (3 ways)
----------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/gravatar.js
Expand Up @@ -9,7 +9,7 @@ var gravatar = module.exports = {
if(typeof protocol === 'undefined'){
baseURL = "//www.gravatar.com/avatar/";
} else {
baseURL = protocol ? "https://secure.gravatar.com/avatar/" : 'http://www.gravatar.com/avatar/';
baseURL = protocol ? "https://s.gravatar.com/avatar/" : 'http://www.gravatar.com/avatar/';
}

var queryData = querystring.stringify(options);
Expand Down
2 changes: 1 addition & 1 deletion test/gravatar.test.js
Expand Up @@ -5,7 +5,7 @@ var should = require('should')
describe('gravatar', function() {
var baseNoProtocolURL = "//www.gravatar.com/avatar/";
var baseUnsecureURL = "http://www.gravatar.com/avatar/";
var baseSecureURL = "https://secure.gravatar.com/avatar/";
var baseSecureURL = "https://s.gravatar.com/avatar/";

it('should gererate correct uri given an email', function() {
gravatar.url('emerleite@gmail.com').should.be.equal(baseNoProtocolURL + "93e9084aa289b7f1f5e4ab6716a56c3b");
Expand Down

0 comments on commit 0fe9be3

Please sign in to comment.