mora-resource-allocation-edge-cloud / mora

1 stars 0 forks source link

Add error message when request is incorrect #32

Open andreaaraldo opened 2 years ago

andreaaraldo commented 2 years ago

It may happen that the client generates an HTTP requests containing into the HTTP field Host an incorrect name, i.e., a different name than the one of the Ingress. (The correct name of the ingress is defined in file deployment/variant/values.cloud.yaml and that can be verified by launching the command kubectl get ingress from the shell of the VM hosting the cluster)

In this case of incorrect HTTP request, the request will go to the Ingress who will check the Host field and will realize that it does not correspond. So far, when this happens, nothing is notified (no messages to the client, no messages in the log, etc.)

Instead, we should add a message at least in the log of the Ingress or the Ingress could reply with an explicit error message to the client.

andreaaraldo commented 2 years ago

Maybe we could use Custom backends?

https://kubernetes.github.io/ingress-nginx/user-guide/custom-errors/