Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

"Content-Disposition" : "attachment" response header getting removed from dispatcher

Avatar

Avatar
Validate 1
Level 2
subramanya75
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
subramanya75
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
subramanya75
Level 2

08-01-2019

We have written a servlet that allows user to download a .csv file from author. The servlet code is adding a response header "Content-Disposition" : "attachment".

When the servlet get request is submitted to author we are able to see the response header -- "Content-Disposition" : "attachment" on the browser.

We have  configured a dispatcher in front of author. When the same request is sent to via dispatcher, the response header "Content-Disposition" : "attachment"  is getting removed. We confirmed the missing header by verifying  the response headers on browser.

The missing response header is causing the downloaded file not to have any extension. Hence user is unable to open the .csv file on his machine as the extension is missing

Am I missing something in dispatcher configuration to allow this response header?

Apache version: 2.4

Dispatcher version: 4.1.12

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
subramanya75
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
subramanya75
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
subramanya75
Level 2

08-01-2019

Hi Amitgupt,

Thank you for the information.

We are passing filename in the header.

This is the code in my servlet : response.setHeader("Content-Disposition", "attachment;filename=SearchResults.csv");

We have found the root cause of the issue. We have F5 load balancer which is in front of Dispatcher and has security rules that blocks the header  "Content-Disposition".

Dispatcher is behind the F5-Load balancer and user request hits dispatcher through F5-LB.

It is the LB which had security rules that blocked the "Content-Disposition" header at LB.

We fixed the security rules on F5-LB.

Issue is finally resolved.

Thanks,

Subramanya

Answers (1)

Answers (1)

Avatar

Avatar
Boost 1
Employee
amitgupta_adbe
Employee

Likes

2 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 1
Affirm 5
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Employee
amitgupta_adbe
Employee

Likes

2 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 1
Affirm 5
Affirm 3
Affirm 1
View profile
amitgupta_adbe
Employee

08-01-2019

are you sure that you are not seeing a cached response from dispatcher? if it is being cached then unless you configure dispatcher to cache headers also see Configuring Dispatcher "Caching HTTP Response Headers"

Also, just "Content-Disposition" : "attachment, does not set the filename. In the absence of filename in header, it will probably guess it from the url.