mirror of https://github.com/apache/cloudstack.git
[EC2 Query API] AuthorizeSecurityGroupIngress fails with 'Server.InternalError 431 Invalid protocol' error.
https://reviews.apache.org/r/8468 Before making the AuthorizeSecurityGroupIngress CloudStack API call, parse the string arguments 'FromPort' and 'ToPort' as an integer.
This commit is contained in:
parent
bea669d091
commit
b514735c7b
|
|
@ -762,11 +762,13 @@ public class EC2RestServlet extends HttpServlet {
|
|||
else break;
|
||||
|
||||
String[] fromPort = request.getParameterValues( "IpPermissions." + nCount + ".FromPort" );
|
||||
if (null != fromPort && 0 < fromPort.length) perm.setProtocol( fromPort[0] );
|
||||
if ( null != fromPort && 0 < fromPort.length)
|
||||
perm.setFromPort( Integer.parseInt( fromPort[0]));
|
||||
|
||||
String[] toPort = request.getParameterValues( "IpPermissions." + nCount + ".ToPort" );
|
||||
if (null != toPort && 0 < toPort.length) perm.setProtocol( toPort[0] );
|
||||
|
||||
if ( null != toPort && 0 < toPort.length)
|
||||
perm.setToPort( Integer.parseInt( toPort[0]));
|
||||
|
||||
// -> list: IpPermissions.n.IpRanges.m.CidrIp
|
||||
int mCount = 1;
|
||||
do
|
||||
|
|
|
|||
Loading…
Reference in New Issue