Skip to content

GraphQLPostInvocationInputParser may distort query string read from HttpServletRequest #385

Closed
@jdlib

Description

@jdlib

GraphQLPostInvocationInputParser uses request.getReader().lines().collect(joining()) to read the query string from the request. This effectively removes all line breaks from the request body.
But the query might have used these line breaks as token separator, therefore the resulting query may become invalid.

Example: Given a request body of

{ 
hero {
name
weight
} }

this will result in a query string {hero {nameweight}} and fail since there is no such attribute.

I would suggest to use request.getReader().lines().collect(joining(" ")) to read the request body, therefore replacing line breaks with a space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions