Github user alasdairhodge commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/790#discussion_r36288309
  
    --- Diff: 
software/webapp/src/main/java/brooklyn/entity/proxy/nginx/NginxControllerImpl.java
 ---
    @@ -117,17 +118,24 @@ public void connectSensors() {
                     .poll(new HttpPollConfig<Boolean>(NGINX_URL_ANSWERS_NICELY)
                             // Any response from Nginx is good.
                             .checkSuccess(Predicates.alwaysTrue())
    -                        .onResult(new Function<HttpToolResponse, 
Boolean>() {
    -                                @Override
    -                                public Boolean apply(HttpToolResponse 
input) {
    -                                    // Accept any nginx response (don't 
assert specific version), so that sub-classing
    -                                    // for a custom nginx build is not 
strict about custom version numbers in headers
    -                                    List<String> actual = 
input.getHeaderLists().get("Server");
    -                                    return actual != null && actual.size() 
== 1;
    -                                }})
    -                        .setOnException(false))
    +                        // Accept any nginx response (don't assert 
specific version), so that sub-classing
    +                        // for a custom nginx build is not strict about 
custom version numbers in headers
    +                        
.onResult(HttpValueFunctions.containsHeader("Server"))
    +                        .setOnException(false)
    +                        .suppressDuplicates(true))
                     .build());
             
    +        // TODO kept anonymous function in case referenced in persisted 
state
    --- End diff --
    
    Argh, I hate this, but realise it's necessary for the time being; looking 
forward to a long-term solution! Perhaps we should add easily-searchable 
markers (as is done for `BROOKLYN_VERSION`), something like: `/* PERSISTENCE 
WORKAROUND */`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to