wp-graphql-cors icon indicating copy to clipboard operation
wp-graphql-cors copied to clipboard

Extension changes the headers content-type

Open pcurt opened this issue 1 year ago • 0 comments

I am using the extension in version 2.1 When I enable the extension it changes the content-type field in my headers from the value application/json into text/html

I got the following headers when the extension is enabled

Headers: {'date': 'Mon, 22 Jan 2024 17:50:26 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'server': 'Apache', 'x-powered-by': 'PHP/8.2', 'vary': 'Accept-Encoding', 'content-encoding': 'gzip', 'x-iplb-request-id': '2001086102080B7054BA6AC2D7380F56:C8D1_200141D0030100000000000000000028:0050_65AEAAE1_6A727:3FCF', 'x-iplb-instance': '52342'}

When I disable the extension and send the same request I have the following headers

Headers: {'date': 'Mon, 22 Jan 2024 17:45:10 GMT', 'content-type': 'application/json; charset=UTF-8', 'transfer-encoding': 'chunked', 'server': 'Apache', 'x-powered-by': 'PHP/8.2', 'access-control-allow-origin': '*', 'access-control-allow-headers': 'Authorization, Content-Type, woocommerce-session', 'access-control-max-age': '600', 'x-robots-tag': 'noindex', 'x-content-type-options': 'nosniff', 'x-graphql-url': 'xxx.com/graphql', 'x-graphql-query-id': '85b5b3f6dab1fe900bb46e5702e1afc94f65c2eef9e75b6a535354bb1362eb9c', 'x-graphql-keys': '85b5b3f6dab1fe900bb46e5702e1afc94f65c2eef9e75b6a535354bb1362eb9c graphql:Query operation:getWooNuxtSettings cGx1Z2luOndwLWdyYXBocWwvd3AtZ3JhcGhxbC5waHA= cGx1Z2luOndwLWdyYXBocWwtd29vY29tbWVyY2Uvd3AtZ3JhcGhxbC13b29jb21tZXJjZS5waHA= cGx1Z2luOndwLWdyYXBocWwtY29ycy0yLjEvd3AtZ3JhcGhxbC1jb3JzLnBocA==', 'access-control-expose-headers': 'woocommerce-session', 'woocommerce-session': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYmFjay5pb3RoZXF1ZS5jb20iLCJpYXQiOjE3MDU5NDU1MTAsIm5iZiI6MTcwNTk0NTUxMCwiZXhwIjoxNzA3MTU1MTEwLCJkYXRhIjp7ImN1c3RvbWVyX2lkIjoidF8yNWYyMjI0NzJlYTM4Y2MyMzU3MTM4NWU3NWNmZGEifX0.YJhII105hdFdcBnBPKh3vWZSFZBQv0mnnGqWPf58dC0', 'x-iplb-request-id': '2001086102080B7054BA6AC2D7380F56:C5BB_200141D0030100000000000000000028:0050_65AEA9A5_60FA:567A', 'x-iplb-instance': '52413'}

I expect to keep the same content-type with the extension enabled or not,

pcurt avatar Jan 22 '24 18:01 pcurt