Subversion Repositories SmartDukaan

Rev

Rev 6601 | Rev 6723 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6601 Rev 6605
Line 459... Line 459...
459
    }
459
    }
460
    
460
    
461
    public String remoteAddr(HttpServletRequest request) {
461
    public String remoteAddr(HttpServletRequest request) {
462
        String remoteAddr = "";
462
        String remoteAddr = "";
463
        String x;
463
        String x;
464
        if ((x = request.getHeader(HEADER_X_FORWARDED_FOR)) != null) {
464
        x = request.getHeader(HEADER_X_FORWARDED_FOR);
-
 
465
        if (x != null && !x.isEmpty()) {
465
            remoteAddr = x;
466
            remoteAddr = x;
466
            int idx = remoteAddr.lastIndexOf(',');
467
            int idx = remoteAddr.lastIndexOf(',');
467
            if (idx > -1) {
468
            if (idx > -1) {
468
                remoteAddr = remoteAddr.substring(idx + 1).trim();
469
                remoteAddr = remoteAddr.substring(idx + 1).trim();
469
            }
470
            }
-
 
471
        } else {
-
 
472
            remoteAddr = request.getRemoteAddr();
470
        }
473
        }
471
        return remoteAddr;
474
        return remoteAddr;
472
    }
475
    }
473
    
476
    
474
    public String getAmount() {
477
    public String getAmount() {