* ============LICENSE_START=======================================================
* ONAP-PAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private static String errorMsg = "error";
private static String operation = "operation";
private static String messageContent = "message";
+
+ private static final String REGEX = "[0-9a-zA-Z._ ]*";
+
@Autowired
public PushPolicyController(CommonClassDao commonClassDao){
PushPolicyController.commonClassDao = commonClassDao;
}
+
+ public void setCommonClassDao(CommonClassDao commonClassDao){
+ PushPolicyController.commonClassDao = commonClassDao;
+ }
/*
* This is an empty constructor
*/
}
if(selectedPDPGroup==null){
String message = "Unknown groupId '" + selectedPDPGroup + "'";
+ if(!message.matches(REGEX) ){
+ message = "Unknown groupId";
+ }
PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE + " " + message);
response.addHeader(errorMsg, "unknownGroupId");
response.addHeader(operation, "push");
- //for fixing Header Manipulation of Fortify issue
- message = message.replace("\n", "");
- message = message.replace("\r", "");
response.addHeader(messageContent, message);
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;