Changeset 1989


Ignore:
Timestamp:
Sep 1, 2011, 4:04:20 PM (12 years ago)
Author:
work@…
Message:
  • fixed restcontroller's getAssays method and removed temporary debug lines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/RestController.groovy

    r1988 r1989  
    443443                                assayModuleURL = new URL(assay.module.url)
    444444                                assayModuleInet = InetAddress.getByName(assayModuleURL.getHost())
    445                                 println "assay module check: ${moduleInet.hostAddress == assayModuleInet.hostAddress}, ${moduleURL.path.replaceAll("/","") == assayModuleURL.path.replaceAll("/","")}, ${assay}"
    446                                 println "modulePath: ${moduleURL.path}"
    447                                 println "assayModulePath: ${assayModuleURL.path}"
    448 
     445
     446                                // check if
     447                                //      1. we've got an assay
     448                                //      2. ip address of module matches
     449                                //      3. the path part of the module matches
    449450                                if (
    450                                         moduleInet.hostAddress == assayModuleInet.hostAddress &&                                                // match ip addresses
    451                                         moduleURL.path.replaceAll("/","") == assayModuleURL.path.replaceAll("/","") &&  // match host path
    452                                         assay                                                                                           // got assay?
     451                                        assay &&
     452                                        moduleInet.hostAddress == assayModuleInet.hostAddress &&
     453                                        (
     454                                                moduleURL.path.replaceAll(/[^a-zA-Z0-9]/,"") ==
     455                                                assayModuleURL.path.replaceAll(/[^a-zA-Z0-9]/,"")
     456                                        )
    453457                                ) {
    454458                                        def map = [assayToken : assay.giveUUID()]
Note: See TracChangeset for help on using the changeset viewer.