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

nextUri should be parsed instead of being consumed directly #100

Open
shawnzhu opened this issue Jul 31, 2020 · 1 comment · May be fixed by #101
Open

nextUri should be parsed instead of being consumed directly #100

shawnzhu opened this issue Jul 31, 2020 · 1 comment · May be fixed by #101

Comments

@shawnzhu
Copy link

What happend

When accessing presto behind a HTTPS proxy, this python sdk won't work when trying to following up the nextUri from query statement. E.g., after creating a query, when following statement:

$ curl -k https://192.168.86.20:31947/v1/statement/queued/20200731_194504_00002_azxv3/y61f7c68358f1460750b1f4fca89c4b272c55d0b3/1
{"id":"20200731_194504_00002_azxv3","infoUri":"http://192.168.86.20:8080/ui/query.html?20200731_194504_00002_azxv3","nextUri":"http://192.168.86.20:8080/v1/statement/executing/20200731_194504_00002_azxv3/ya4b5bce0c6391da9d771a40df96d4723d2280b81/0","stats":{"state":"QUEUED","queued":true,"scheduled":false,"nodes":0,"totalSplits":0,"queuedSplits":0,"runningSplits":0,"completedSplits":0,"cpuTimeMillis":0,"wallTimeMillis":0,"queuedTimeMillis":29,"elapsedTimeMillis":381605,"processedRows":0,"processedBytes":0,"peakMemoryBytes":0,"spilledBytes":0},"warnings":[]}

Notice that the nextUri does not starts with HTTPS.

As a consequence, the python client will fail since it tries to use the value of this nextUri directly:

@property
def next_uri(self):
# type: () -> Text
return self._next_uri

Expected outcome

It should parse the value of nextUri then format it just like that for the statement url.

@shawnzhu shawnzhu linked a pull request Jul 31, 2020 that will close this issue
@shawnzhu
Copy link
Author

shawnzhu commented Aug 1, 2020

After using server configuration option http-server.process-forwarded=true from trinodb/trino#3714 I don't have this problem anymore.

This case only happens when http-server.process-forwarded=false where it won't use the expect scheme when presto is behind a HTTPS proxy.

@shawnzhu shawnzhu changed the title nextUri should be parsed instead of consumed directly nextUri should be parsed instead of being consumed directly Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant