-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
proposalAn issue that proposes a feature requestAn issue that proposes a feature requestready for refinementAn issue that was triaged and it is ready to be refinedAn issue that was triaged and it is ready to be refined
Description
Version
edge
What Kubernetes platforms are you running on?
Minikube
Description:
When defining a VirtualServer resource - you can set a preconfigured response - one of the fields it supports is type which according to the docs sets "The MIME type of the response"
In fact - it only sets the default_type (nginx docs) (location in source code) - the implications are that despite setting the desired Content-Type value - when the URI ends with an extension - nginx "guesses" the Content-Type based on the map in /etc/nginx/mime.types
Expected Behavior
When defining a type in a route with return action - it should always return that type as Content-Type, and should ignore not use the extension in the URI to assume the content type
Steps To Reproduce:
- Apply this following
VirtualServeryaml (sethostaccording to your installation):
apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
name: virtual-server-bug-demo
spec:
host: vs-bug-demo.localhost
routes:
- path: /
action:
return:
body: "Not Found"
code: 404
type: text/plain- Browse to http://vs-bug-demo.localhost/not-found - All good, response is 404 with content type
text/plain - Browse to http://vs-bug-demo.localhost/not-found/somelinkwith.mp4 - Server response with
Content-type: video/mp4(body still contains the string "Not Found" - which cause the browser to show an invalid video player)
Metadata
Metadata
Assignees
Labels
proposalAn issue that proposes a feature requestAn issue that proposes a feature requestready for refinementAn issue that was triaged and it is ready to be refinedAn issue that was triaged and it is ready to be refined
Type
Projects
Status
Prioritized backlog