Does anyone know what headers Netsuite requires to...
# suitescript
d
Does anyone know what headers Netsuite requires to properly handle a PDF fetched using
https.get()
in a UserEvent script? It currently comes through corrupted, even though the Content Type is
application/pdf
b
what do the response headers look like?
d
Copy code
{
	"type": "http.ClientResponse",
	"code": 200,
	"headers": {
		"Cache-Control": "must-revalidate, no-cache, no-store, private, max-age=0",
		"cache-control": "must-revalidate, no-cache, no-store, private, max-age=0",
		"Content-Security-Policy": "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline'",
		"content-security-policy": "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline'",
		"Content-Type": "application/pdf; charset=utf-8",
		"content-type": "application/pdf; charset=utf-8",
		"Date": "Wed, 07 Dec 2022 02:24:19 GMT",
		"date": "Wed, 07 Dec 2022 02:24:19 GMT",
		"Server": "nginx",
		"server": "nginx",
		"Strict-Transport-Security": "max-age=631138519; includeSubdomains",
		"strict-transport-security": "max-age=631138519; includeSubdomains",
		"Transfer-Encoding": "chunked",
		"transfer-encoding": "chunked",
		"Via": "1.1 mono002.prod-syd-ap1.core.ns.internal",
		"via": "1.1 mono002.prod-syd-ap1.core.ns.internal",
		"X-Content-Type-Options": "nosniff",
		"x-content-type-options": "nosniff",
		"X-Download-Options": "noopen",
		"x-download-options": "noopen",
		"X-Frame-Options": "SAMEORIGIN",
		"x-frame-options": "SAMEORIGIN",
		"X-Permitted-Cross-Domain-Policies": "none",
		"x-permitted-cross-domain-policies": "none",
		"X-Rack-Cache": "miss",
		"x-rack-cache": "miss",
		"X-Request-Id": "544b44bf760831fc03354826e396f073",
		"x-request-id": "544b44bf760831fc03354826e396f073",
		"X-Runtime": "0.462364",
		"x-runtime": "0.462364",
		"X-UA-Compatible": "IE=Edge,chrome=1",
		"x-ua-compatible": "IE=Edge,chrome=1",
		"X-Ua-Compatible": "IE=Edge,chrome=1",
		"X-XSS-Protection": "1; mode=block",
		"x-xss-protection": "1; mode=block",
		"X-Xss-Protection": "1; mode=block"
	},
	"body": "%PDF-1.5\n%����\n
b
content type is wrong
Copy code
"application/pdf; charset=utf-8"
will be interpreted as utf-8, which is wrong
pdfs arent utf-8
d
thanks