Adding custom http headers to tRESTResponse

Six Stars

Adding custom http headers to tRESTResponse

Is it possible to add custom http headers to a tRESTResponse? I know that there is an enhancement request for doing this and it is still not in progress of being worked on (https://jira.talendforge.org/browse/TESB-6057). I would need this so that I can implement CORS. I do not wish to use JSONP since it would require more logic and be more of a "work-around".
Could I add http headers using tGroovy or tJavaFlex?
Highlighted
Six Stars

Re: Adding custom http headers to tRESTResponse

This enhancement has been implemented in version 5.2. See tRESTResponse/Advanced Settings to add manual http headers.
For CORS, just add the http header "Access-Control-Allow-Origin" with the value "*" to the tRESRResponse component.
Highlighted
One Star

Re: Adding custom http headers to tRESTResponse

Dear Talend ESB Team,
Using last version of 5.6 in component TRestResponse and adding "Access-Control-Allow-Origin" with the value "*" , we still are getting the same CORS problem.
Do you know why header is not seen at http response?
 
Highlighted
One Star

Re: Adding custom http headers to tRESTResponse

We restarted Runtime ESB and it worked.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog