code: public static Map<String,String> buildHeaders( String reqCorsHeader, String requestUri ) {
  
  		Map<String,String> result = new LinkedHashMap<> ();
  		result.put( CORS_ALLOW_ORIGIN, requestUri );
  		result.put( CORS_ALLOW_METHODS, VALUE_ALLOWED_METHODS );
  		result.put( CORS_ALLOW_CREDENTIALS, VALUE_ALLOW_CREDENTIALS );
  
  		if( ! Utils.isEmptyOrWhitespaces( reqCorsHeader ))
  			result.put( CORS_ALLOW_HEADERS, reqCorsHeader );
  
  		return result;
  	}
docs: Finds the right headers to set on the response to prevent CORS issues.
  @param reqCorsHeader the headers related to CORS
  @return a non-null map