|
12 | 12 | ################################################################################
|
13 | 13 | ## checking HTTP HEAD responses
|
14 | 14 | ################################################################################
|
15 |
| - |
16 | 15 | context "head requests:" do
|
17 | 16 | it "checks whether HEAD returns a body on 2xx" do
|
18 | 17 | cmd = "/_api/version"
|
|
144 | 143 | end
|
145 | 144 | end
|
146 | 145 |
|
| 146 | +################################################################################ |
| 147 | +## checking GZIP requests |
| 148 | +################################################################################ |
| 149 | + |
| 150 | + context "gzip requests" do |
| 151 | + before do |
| 152 | + @headers = "DELETE, GET, HEAD, PATCH, POST, PUT" |
| 153 | + end |
| 154 | + |
| 155 | + it "checks handling of an request, with gzip support" do |
| 156 | + require 'uri' |
| 157 | + require 'net/http' |
| 158 | + uri = URI.parse("http://127.0.0.1/_db/_system/_admin/aardvark/standalone.html") |
| 159 | + uri.port = 8529 |
| 160 | + http = Net::HTTP.new(uri.host, uri.port) |
| 161 | + |
| 162 | + request = Net::HTTP::Get.new(uri.request_uri) |
| 163 | + request["Accept-Encoding"] = "gzip" |
| 164 | + response = http.request(request) |
| 165 | + |
| 166 | + # check content encoding |
| 167 | + response['content-encoding'].should eq('gzip') |
| 168 | + end |
| 169 | + |
| 170 | + it "checks handling of an request, without gzip support" do |
| 171 | + cmd = "/_admin/aardvark/standalone.html" |
| 172 | + doc = ArangoDB.log_get("admin-interface-get", cmd, :headers => { "Accept-Encoding" => "" }, :format => :plain) |
| 173 | + |
| 174 | + # check response code |
| 175 | + doc.code.should eq(200) |
| 176 | + # check content encoding |
| 177 | + doc.headers['Content-Encoding'].should be nil |
| 178 | + end |
| 179 | + end |
| 180 | + |
147 | 181 | ################################################################################
|
148 | 182 | ## checking CORS requests
|
149 | 183 | ################################################################################
|
|
0 commit comments