Skip to content

Commit 1380028

Browse files
authored
Allow for VPACK encoding in _api/gharial API (#512)
1 parent 8098de7 commit 1380028

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Add support for refilling index caches
1919
- [V2] Retriable batch reads in AQL cursors
2020
- Add log level support for a specific server
21+
- Allow for VPACK encoding in _api/gharial API
2122

2223
## [1.5.2](https://github.com/arangodb/go-driver/tree/v1.5.2) (2023-03-01)
2324
- Bump `DRIVER_VERSION`

http/connection.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
1717
//
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
20-
// Author Ewout Prangsma
21-
//
2220

2321
package http
2422

@@ -204,18 +202,12 @@ func (c *httpConnection) NewRequest(method, path string) (driver.Request, error)
204202
return nil, driver.WithStack(driver.InvalidArgumentError{Message: fmt.Sprintf("Invalid method '%s'", method)})
205203
}
206204

207-
ct := c.contentType
208-
if ct != driver.ContentTypeJSON && strings.Contains(path, "_api/gharial") {
209-
// Currently (3.1.18) calls to this API do not work well with vpack.
210-
ct = driver.ContentTypeJSON
211-
}
212-
213205
r := &httpRequest{
214206
method: method,
215207
path: path,
216208
}
217209

218-
switch ct {
210+
switch c.contentType {
219211
case driver.ContentTypeJSON:
220212
r.bodyBuilder = NewJsonBodyBuilder()
221213
return r, nil

0 commit comments

Comments
 (0)