Fixed JERSEY-1278.

- Fix ported from Jersey 1.x.

Change-Id: I7f624f3e240c4e143a52c940a28b91da150600e7
Signed-off-by: Marek Potociar <marek.potociar@oracle.com>
Merge "Fixed JERSEY-1278."