1
0
mirror of https://github.com/MailHops/mailhops-node.git synced 2025-05-15 11:20:12 -07:00

Fixed IP order when Received header has multiple IPs.

This commit is contained in:
Andrew Van Tassel 2017-02-21 20:08:48 -07:00
parent d399507458
commit 38a0863a1a
4 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.
## 2.1.0 - 2017-02-21
### Fixed
- IP order when Received header has multiple IPs.
## 2.0.2 - 2016-12-09
### Added

View File

@ -77,7 +77,7 @@ module.exports = {
});
//maybe multiple IPs in one Received: line
_.each(received_ips, function(ip){
_.eachRight(received_ips, function(ip){
var firstchar = line.substring(line.indexOf(ip)-1).substring(0,1);
var lastchar = line.substring(line.indexOf(ip)+ip.length).substring(0,1);
@ -129,7 +129,7 @@ module.exports = {
});
//maybe multiple IPs in one Received: line
_.each(received_ips, function(ip){
_.eachRight(received_ips, function(ip){
var firstchar = line.substring(line.indexOf(ip)-1).substring(0,1);
var lastchar = line.substring(line.indexOf(ip)+ip.length).substring(0,1);

View File

@ -1,6 +1,6 @@
{
"name": "mailhops",
"version": "2.0.6",
"version": "2.1.0",
"description": "A nodejs module for interacting with the MailHops API.",
"main": "main.js",
"scripts": {

View File

@ -92,10 +92,10 @@ describe("main", function(){
it('should find 9 Received IPs', function(done){
assert.deepEqual(ips,['130.235.227.36',
'130.235.56.196',
'130.236.48.25',
'130.235.59.236',
'130.235.56.196',
'130.235.56.196',
'130.235.59.236',
'127.0.0.1',
'54.157.138.253',
'198.21.5.108',