Skip to content

Commit 235740d

Browse files
author
Kelvin Wijaya
authored
Merge pull request #11 from GovTechSG/development
Development
2 parents 96d931e + 45afc34 commit 235740d

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@
2828
+ Update README documentation
2929
### V1.3.1-SNAPSHOT
3030
+ Update dependency library for jackson-databind to version 2.9.8
31-
+ Update mvn command to pull centralised unit-test cases from github repository
31+
+ Update mvn command to pull centralised unit-test cases from github repository
32+
### V1.3.2-SNAPSHOT
33+
+ Update ApiSigning class to support non-standard http port

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mvn install
6363
<dependency>
6464
<groupId>com.api.util</groupId>
6565
<artifactId>ApiSecurity</artifactId>
66-
<version>1.3.1-SNAPSHOT</version>
66+
<version>1.3.2-SNAPSHOT</version>
6767
</dependency>
6868
```
6969

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'com.github.kt3k.coveralls' version '2.6.3'
55
}
66

7-
version '1.3.1-SNAPSHOT'
7+
version '1.3.2-SNAPSHOT'
88

99
tasks.withType(JavaCompile) {
1010
options.encoding = "UTF-8"

pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.api.util</groupId>
44
<artifactId>ApiSecurity</artifactId>
5-
<version>1.3.1-SNAPSHOT</version>
5+
<version>1.3.2-SNAPSHOT</version>
66
<build>
77
<plugins>
88
<plugin>
@@ -45,6 +45,16 @@
4545
</execution>
4646
</executions>
4747
</plugin>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-scm-plugin</artifactId>
51+
<version>1.8.1</version>
52+
<configuration>
53+
<connectionType>developerConnection</connectionType>
54+
<scmVersion>master</scmVersion>
55+
<scmVersionType>branch</scmVersionType>
56+
</configuration>
57+
</plugin>
4858
</plugins>
4959
</build>
5060
<dependencies>

src/main/java/com/api/util/ApiSecurity/ApiSigning.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,15 @@ public static String getBaseString(String authPrefix
453453
if (!siteUri.getScheme().equals("http") && !siteUri.getScheme().equals("https")) {
454454
throw new ApiUtilException("Support http and https protocol only.");
455455
}
456-
456+
457+
String url = null;
457458
// make sure that the port no and querystring are remove from url
458-
String url = String.format("%s://%s%s", siteUri.getScheme(), siteUri.getHost(), siteUri.getPath());
459+
if(siteUri.getPort()==-1 || siteUri.getPort()==80 || siteUri.getPort()==443){
460+
url = String.format("%s://%s%s", siteUri.getScheme(), siteUri.getHost(), siteUri.getPath());
461+
}else{
462+
url = String.format("%s://%s:%s%s", siteUri.getScheme(), siteUri.getHost(), siteUri.getPort(), siteUri.getPath());
463+
}
464+
459465
log.debug("url:: {}", url);
460466

461467
// helper calss that handle parameters and form fields

0 commit comments

Comments
 (0)