framework/st_things : Modify logic when 'remove_query_parameter' occured.
1. Currently, the query removes if and rt in any state.
2. However, if the query is 'if', 'if' is delete, and if it is 'rt', 'rt' is delete.
@@ -831,9 +831,13 @@ bool handle_get_req_helper(const char *res_uri, const char *query, OCRepPayload
}
// Remove 'rt' and 'if' from query parameters
if (NULL != query && strlen(query) > 0) {
+ if (strstr(req_msg->query, OC_RSRVD_RESOURCE_TYPE) != NULL) {
remove_query_parameter(req_msg->query, OC_RSRVD_RESOURCE_TYPE);
+ }
+ if (strstr(req_msg->query, OC_RSRVD_INTERFACE) != NULL) {
remove_query_parameter(req_msg->query, OC_RSRVD_INTERFACE);
}
+ }
// Setup the response representation for application. This representation will be handed over to the application.
st_things_representation_s *things_resp_rep = create_representation_inst_internal(resp_payload);
if (NULL != things_resp_rep) {
@@ -1004,9 +1008,12 @@ bool handle_post_req_helper(const char *res_uri, const char *query, OCRepPayload
if (res) {
// Remove 'rt' and 'if' from query parameters.
+ if (strstr(req_msg->query, OC_RSRVD_RESOURCE_TYPE) != NULL) {
remove_query_parameter(req_msg->query, OC_RSRVD_RESOURCE_TYPE);
+ }
+ if (strstr(req_msg->query, OC_RSRVD_INTERFACE) != NULL) {
remove_query_parameter(req_msg->query, OC_RSRVD_INTERFACE);
-
+ }
res = g_handle_set_req_cb(req_msg, things_resp_rep);
THINGS_LOG_D(TAG, "The result of application's callback : %s", res ? "true" : "false");
} else {
