Suppress Accept-Encoding: gzip, deflate?

1,063 views
Skip to first unread message

Ted M. Young

unread,
Jun 28, 2013, 4:12:04 PM6/28/13
to rest-a...@googlegroups.com
Hi,

I commented on issue #77 (https://code.google.com/p/rest-assured/issues/detail?id=77), and would be happy to submit a pull request, but it's unclear to me how best to handle this.

First, the problem I'm trying to solve:

I'm using REST-Assured to test against a Jersey/Jetty-based service and verify ETags in different situations. It turns out that when the Accept-Header has 'gzip', the server will compress the body and modify the ETag by appending -gzip to it. This means we have to manually remove the -gzip from the returned ETag in order to test that it's the ETag we expect. This is a pain.

It looks like the ContentEncoding class is intercepting and always adding 'gzip, deflate' to the Accept-Header in the Request. I can't see a way to change this via any of the configuration classes (seems like it could be part of the EncoderConfig?).

Any suggestions?

Thanks,
;ted
--

Johan Haleby

unread,
Jul 1, 2013, 2:18:28 AM7/1/13
to rest-a...@googlegroups.com
Hi Ted, 

I'm really glad you want to help out. I haven't looked into this in great detail but if I remember it correctly it's HTTP Builder that automatically applies the accept header automatically. My idea is to remove this hard-coded setting and instead extract it to an "EncoderRegistry" (or EncoderConfig) or something. Here it ought to be possible to set (or remove) the default accept header and also be able to register custom content encoders etc (perhaps in the first iteration it would be fine to just be able to specify (or de-specify) the accepter header). So it should be something similar to the Configs that are already present in RA. For backward compatibility we should retain the Gzip Accept-Header as default.

Regards,
/Johan



--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Zlika

unread,
Jul 1, 2013, 5:53:19 AM7/1/13
to rest-a...@googlegroups.com
Hi all,
I wrote a comment in http://code.google.com/p/rest-assured/issues/detail?id=154 , which is a similar issue as this one.
Regards
Thomas
Reply all
Reply to author
Forward
0 new messages