Ask Your Question
1

How do I allow restricted headers with HTTP Client

asked 2019-09-25 10:04:45 -0500

Kass gravatar image

updated 2019-09-25 11:20:02 -0500

metadaddy gravatar image

Hi I'm running SDC 3.10.1 in a Docker container (the streamsets/datacollector:3.10.1 image) I am trying to make an HTTP call with HTTPClient using a restricted header like following:

curl -X GET -H "Host: my-host" http://my-service/my-endpoint

but my header is by default ignored with the warning:

'HttpUrlConnector - Attempt to send restricted header(s) while the [sun.net.http.allowRestrictedHeaders] system property not set. Header(s) will possibly be ignored'

Where do I have to put this system property to? Adding it in my 'sdc.properties' didn't fix my problem. Thank you in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-09-25 11:19:33 -0500

metadaddy gravatar image

You need to set the SDC_JAVA_OPTS environment variable - this gets passed to the JVM. You can do so from docker run like this:

docker run --env SDC_JAVA_OPTS="-Dsun.net.http.allowRestrictedHeaders=true" ...
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-25 10:01:50 -0500

Seen: 45 times

Last updated: Sep 25