Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Allowing getting the scheme, serverPort, and serverName
Browse files Browse the repository at this point in the history
Spring-test allows for getting these properties, so the change to throw UnsupportedOperationException when they're retrieved is a backwards-compatibility breaking change. These properties are easy to get from the request URI, so this commit does that.
  • Loading branch information
candrews committed Jun 5, 2014
1 parent d289e04 commit 58d6751
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ class MailMessageContentRenderer {
throw new UnsupportedOperationException("You cannot read the protocol in non-request rendering operations")
}
if (methodName == 'getScheme') {
throw new UnsupportedOperationException("You cannot read the scheme in non-request rendering operations")
return new URI(requestURI).scheme
}
if (methodName == 'getServerName') {
throw new UnsupportedOperationException("You cannot read server name in non-request rendering operations")
return new URI(requestURI).host
}
if (methodName == 'getServerPort') {
throw new UnsupportedOperationException("You cannot read the server port in non-request rendering operations")
return new URI(requestURI).host
}
if (methodName == 'getReader') {
throw new UnsupportedOperationException("You cannot read input in non-request rendering operations")
Expand Down

0 comments on commit 58d6751

Please sign in to comment.