graphql-server icon indicating copy to clipboard operation
graphql-server copied to clipboard

Account for content type being included twice

Open ElementalWarrior opened this issue 11 months ago • 3 comments

Chrome appears to be providing content type twice sometimes, this results in load_json_body not being called.

Content-Type: application/json, application/json; charset=utf-8

ElementalWarrior avatar Jul 07 '23 15:07 ElementalWarrior

Could you elaborate on how did you encounter this issue? We encountered a similar issue with graphene-django earlier graphql-python/graphene-django#1404. Not sure if the two issues are related but would be nice to know the root cause of this if possible.

kiendang avatar Aug 03 '23 18:08 kiendang

Could you elaborate on how did you encounter this issue? We encountered a similar issue with graphene-django earlier graphql-python/graphene-django#1404. Not sure if the two issues are related but would be nice to know the root cause of this if possible.

Our FE code requested with headers Content-Type and separately content-type.

Chrome combines and sends as one.

ElementalWarrior avatar Aug 04 '23 01:08 ElementalWarrior

Our FE code requested with headers Content-Type and separately content-type.

Chrome combines and sends as one.

This was exactly the issue we had too. We fixed the code in graphene-django to include only content-type.

I think in this case the best solution if possible is changing the front end code to specify only content-type (preferably lowercase) but since you submitted this PR I guess that's difficult?

Right now I'm reluctant to accept this PR. The spec for media types in content-type clearly allows only 1 set of type/subtype so this change would go against the spec.

kiendang avatar Aug 04 '23 06:08 kiendang