Skip to content

Commit a6e7f6e

Browse files
Merge pull request #27 from signalsciences/graphql
allow graphql content-types
2 parents a4ea539 + 548fc8d commit a6e7f6e

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# GoLang Module Release Notes
22

3+
## 1.10.0 2021-05-26
4+
5+
* Added support for `application/graphql` content-type
6+
37
## 1.9.0 2020-10-22
48

59
* Added `server_flavor` config option.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.0
1+
1.10.0

module.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ func inspectableContentType(s string) bool {
473473
// gRPC (protobuf)
474474
case strings.HasPrefix(s, "application/grpc"):
475475
return true
476+
477+
// GraphQL
478+
case strings.HasPrefix(s, "application/graphql"):
479+
return true
476480
}
477481

478482
return false

module_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ func TestInspectableContentType(t *testing.T) {
270270
{true, "text/x-javascript"},
271271
{true, "text/x-json"},
272272
{true, "application/javascript"},
273+
{true, "application/graphql"},
273274
{false, "octet/stream"},
274275
{false, "junk/yard"},
275276
}
@@ -328,6 +329,7 @@ func TestModule(t *testing.T) {
328329
{genTestRequest("POST", "http://example.com/", "application/rss+xml", `<a>1</a>`), 403, "XSS"},
329330
{genTestRequest("POST", "http://example.com/", "application/rss+xml", `<a>1</a>`), 500, "XSS"},
330331
{genTestRequest("POST", "http://example.com/", "application/rss+xml", `<a>1</a>`), 200, ""},
332+
{genTestRequest("POST", "http://example.com/", "application/graphql", `{}`), 200, ""},
331333
}
332334

333335
for pos, tt := range cases {

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package sigsci
22

3-
const version = "1.9.0"
3+
const version = "1.10.0"

0 commit comments

Comments
 (0)