This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 282608 - [filetransfer] allow client to specify request headers as option
Summary: [filetransfer] allow client to specify request headers as option
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.filetransfer (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.1.0   Edit
Assignee: ecf.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 00:10 EDT by Scott Lewis CLA
Modified: 2018-11-09 14:31 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Lewis CLA 2009-07-07 00:10:32 EDT
Currently, the ECF filetransfer API allows arbitrary options (Map) to be specified upon initiating a file transfer.  It would be useful to allow clients to specify request headers as an option.
Comment 1 Scott Lewis CLA 2009-07-07 00:11:01 EDT
Setting target milestone to 3.1
Comment 2 Henrich Kraemer CLA 2009-07-09 16:20:16 EDT
Additionally an API that allows clients to see received responses with headers (but not their payload) and to be able to add, remove or modify headers of outgoing requests would be valuable. 
Clients using the API would be protocol aware for example HTTP unless they used it only for logging, for example to log failed requests.

This would allow for more dynamic usage of headers based on server responses and also would allow client to take into account redirects etc.
Comment 3 Scott Lewis CLA 2010-05-13 12:07:21 EDT
This has been added in 3.6 release cycle.  Resolving as fixed.
Comment 4 Christoph Laeubrich CLA 2018-11-09 13:29:09 EST
As this is marked as fixed: Where can I find information how to do so?
I'd like to filter all ECF requests and add custom header to it. I have searched for a while but can't find any information about this, maybe I'm using the wrong keywords?
Comment 5 Scott Lewis CLA 2018-11-09 14:31:52 EST
See the source and javadocs for this constant:

org.eclipse.ecf.filetransfer.IRetrieveFileTransferOptions.REQUEST_HEADERS

Here in git repo

http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/framework/bundles/org.eclipse.ecf.filetransfer/src/org/eclipse/ecf/filetransfer/IRetrieveFileTransferOptions.java

Using this key, a Map of header name/values can be passed in options and the names/values will be put into the request as request headers/values.   The code for this for httpclient4 provider (currently one used by p2 on apache httpclient) is here:

http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java

Line 379:  setRequestHeaderValuesFromOptions() method.