fix(cors-plugin): Ensure reason is set for HTTP responses
Fixes:
MODIFY
cors-policy/src/main/java/io/apiman/plugins/cors_policy/CorsConfigBean.java
cors-policy/src/main/java/io/apiman/plugins/cors_policy/CorsConfigBean.java
@@ -288,6 +288,9 @@ public class CorsConfigBean implements Serializable {
* @return true if origin is allowed
*/
public boolean isAllowedOrigin(String origin, String host) {
+ if (origin == null || host == null) {
+ return false;
+ }
return (host.equals(origin) || allowOrigin.contains("*") || allowOrigin.contains(origin)); //$NON-NLS-1$
}

MODIFY
cors-policy/src/main/java/io/apiman/plugins/cors_policy/CorsConnector.java
cors-policy/src/main/java/io/apiman/plugins/cors_policy/CorsConnector.java
@@ -255,6 +255,7 @@ public class CorsConnector implements IApiConnector {
response = new ApiResponse();
response.setCode(200);
+ response.setMessage("OK"); //$NON-NLS-1$
response.setHeaders(responseHeaders);
}

fix(cors-plugin): Ensure reason is set for HTTP responses

Fixes: APIMAN-1271