diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 66f9cf6aa..3e1ea202a 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ +- [cygnus-ngsi][restHandler] Add header value to logs about bad header (#2410) - [cygnus-ngsi] Upgrade Debian version from 12.5 to 12.6 in Dockerfile - [cygnus-common][cygnus-ngsi] New setting mongo_uri (#2387) - [cygnus-common][cygnus-ngsi] Deprecate (mongo_hosts, mongo_username, mongo_password, mongo_auth_source, mongo_replica_set) (use mongo_uri instead) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java index fc88794d7..48080f000 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java @@ -213,11 +213,11 @@ public List getEvents(javax.servlet.http.HttpServletRequest request) thro LOGGER.warn("[NGSIRestHandler] Bad HTTP notification ('" + CommonConstants.HEADER_FIWARE_SERVICE + "' header length greater than " - + NGSIConstants.SERVICE_HEADER_MAX_LEN + ")"); + + NGSIConstants.SERVICE_HEADER_MAX_LEN + ") for " + headerValue); throw new HTTPBadRequestException( "'" + CommonConstants.HEADER_FIWARE_SERVICE + "' header length greater than " - + NGSIConstants.SERVICE_HEADER_MAX_LEN + ")"); + + NGSIConstants.SERVICE_HEADER_MAX_LEN + ") for " + headerValue); } else { service = headerValue; } // if else @@ -231,17 +231,17 @@ public List getEvents(javax.servlet.http.HttpServletRequest request) thro LOGGER.warn("[NGSIRestHandler] Bad HTTP notification ('" + CommonConstants.HEADER_FIWARE_SERVICE_PATH + "' header value length greater than " - + NGSIConstants.SERVICE_PATH_HEADER_MAX_LEN + ")"); + + NGSIConstants.SERVICE_PATH_HEADER_MAX_LEN + ") for " + headerValue); throw new HTTPBadRequestException( "'fiware-servicePath' header length greater than " - + NGSIConstants.SERVICE_PATH_HEADER_MAX_LEN + ")"); + + NGSIConstants.SERVICE_PATH_HEADER_MAX_LEN + ") for " + headerValue); } else if (wrongServicePathHeaderInitialCharacter(splitValue)) { LOGGER.warn("[NGSIRestHandler] Bad HTTP notification ('" + CommonConstants.HEADER_FIWARE_SERVICE_PATH - + "' header value must start with '/'"); + + "' header value " + headerValue + " must start with '/'"); throw new HTTPBadRequestException( "'" + CommonConstants.HEADER_FIWARE_SERVICE_PATH - + "' header value must start with '/'"); + + "' header value " + headerValue + " must start with '/'"); } // if else } // for @@ -252,7 +252,7 @@ public List getEvents(javax.servlet.http.HttpServletRequest request) thro ngsiVersion = headerValue; break; default: - LOGGER.debug("[NGSIRestHandler] Unnecessary header"); + LOGGER.debug("[NGSIRestHandler] Unnecessary header: " + headerName + " value " + headerValue); } // switch } // while