Skip to content

fixes #3

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

Merged
merged 4 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions chart/config/proxy/lib.gitpod-plugins.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ if ($action = preflight) {
response = ngx.location.capture(url);
if response.status == ngx.HTTP_OK then
ngx.var.targetUrl = response.body;
my_url = "/plugins-workaround?url=" .. ngx.escape_uri(ngx.var.targetUrl);
fixed_url_resp = ngx.location.capture(my_url);
if fixed_url_resp.status == ngx.HTTP_OK then
ngx.log(ngx.ERR, "ALL GOOD " .. fixed_url_resp.body)
ngx.var.targetUrl = fixed_url_resp.body
else
ngx.log(ngx.ERR, "FAILED" .. fixed_url_resp.status)
end
else
ngx.log(ngx.ERR, "Bad Request: /plugins/preflight returned with code " .. response.status)
return ngx.exit(400)
Expand Down
8 changes: 7 additions & 1 deletion chart/config/proxy/lib.locations.conf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ location /plugins-preflight {
proxy_read_timeout 3600s;
proxy_pass http://apiserver/plugins/preflight?$query_string;
}

location /plugins-workaround {
# this is an internal location used only for the subrequest (cf. /plugins) as
# it's not possible to pass from within the fetch in lua code.
internal;
proxy_read_timeout 3600s;
proxy_pass http://minio-signed-url-fixer:8000/get-signed-url/?$query_string;
}
##### Workspace download
location /workspace-download {
set $qs "${request_uri}";
Expand Down