Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Query generated from windows doesn't work #41600

Closed
hanechris opened this issue Jul 2, 2024 · 2 comments · Fixed by #41685
Closed

GraphQL Query generated from windows doesn't work #41600

hanechris opened this issue Jul 2, 2024 · 2 comments · Fixed by #41685
Labels
area/graphql area/smallrye env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@hanechris
Copy link

Describe the bug

When using restassured, sending a graphQL query returns a malformed error. The issue is in SmallRyeGraphQLExecutionHandler. This patter:

PATTERN_NEWLINE_OR_TAB = Pattern.compile("\\n|\\t");

Needs to also remove \r. \r remains in the string and isn't parsed by the JSON parser. Hence malformed.

I stripped before sending to the server to fix. Would be nice if fixed in the code above.

Expected behavior

Strip \r in addition to \n and \t

Actual behavior

Generates a malformed query exception.

How to Reproduce?

No response

Output of uname -a or ver

windows 11

Output of java -version

22

Quarkus version or git rev

3.9.2

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@hanechris hanechris added the kind/bug Something isn't working label Jul 2, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 2, 2024

/cc @jmartisk (graphql), @phillip-kruger (graphql)

@jmartisk
Copy link
Contributor

jmartisk commented Jul 2, 2024

Ok, I struggled a bit to reproduce this because I don't have a Windows machine handy, but this seems to reproduce it on Linux:

# create a query that contains LF inside
echo -e "{\"query\": \"{__typename\n}\"}" > QUERY_LF
# create a query that contains CR+LF inside
echo -e "{\"query\": \"{__typename\r\n}\"}" > QUERY_CRLF
# execute with LF - works
curl -v localhost:8080/graphql --data-binary @QUERY_LF
# execute with CR+LF - doesn't work
curl -v localhost:8080/graphql --data-binary @QUERY_CRLF

We'll fix this, thanks for reporting.

@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jul 4, 2024
@gsmet gsmet modified the milestones: 3.13 - main, 3.12.2 Jul 9, 2024
@gsmet gsmet modified the milestones: 3.12.2, 3.8.6 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql area/smallrye env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants