This commit is contained in:
Rossen Stoyanchev
2014-07-17 09:24:45 -04:00
parent 59f39706dc
commit 44e4569150
2 changed files with 11 additions and 11 deletions

View File

@@ -188,11 +188,11 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH
}
}
String name = DestinationPatternsMessageCondition.LOOKUP_DESTINATION_HEADER;
String destination = (String)message.getHeaders().get(name);
if (StringUtils.hasLength(destination) && !destination.startsWith("/")) {
destination = "/" + destination;
}
return new String[] { defaultPrefix + destination };
String destination = (String) message.getHeaders().get(name);
Assert.hasText(destination, "No lookup destination header in " + message);
return (destination.startsWith("/") ?
new String[] {defaultPrefix + destination} : new String[] {defaultPrefix + "/" + destination});
}
private MessageHeaders createHeaders(String sessionId) {