Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Copy response headers through proxied requests #35

Closed
wants to merge 1 commit into from

Conversation

torchiaf
Copy link

Description

The response headers are truncate for proxied https requests to Epinio server.

Motivation and Context

One of the missing response headers is X-Content_Length, which should be used to calculate download progress on the UI.
Related issue: epinio/ui#223

@torchiaf torchiaf self-assigned this Jun 27, 2023
@torchiaf torchiaf changed the title Copy response header in proxied requests Copy response headers through proxied requests Jul 3, 2023
@torchiaf torchiaf marked this pull request as ready for review July 3, 2023 11:21
src/jetstream/passthrough.go Show resolved Hide resolved
src/jetstream/passthrough.go Outdated Show resolved Hide resolved
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
@@ -593,6 +594,10 @@ func (p *portalProxy) ProxySingleRequest(c echo.Context) error {
go p.doRequest(&cnsiRequest, done)
res := <-done

// Copy custom content-length header from original response header
contentLength := "x-content-length"
c.Response().Header().Set(contentLength, res.ResponseHeader.Get(contentLength))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i still couldn't get this to work, the status bar does not change until the download has finished.

realised why though, we need to pipe updates from the proxied request (ui backend --> epinio) to the client request (client --> ui backend)

@richard-cox
Copy link
Member

I've just merged epinio/ui#286, so these changes need porting to the new location

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants