Add Content-Length and Content-Disposition Header

for GetFileContent route.
This commit is contained in:
Maximilian Paß
2022-09-28 21:49:35 +01:00
parent 0c70ad3b24
commit 195f88177e
10 changed files with 161 additions and 28 deletions

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"github.com/openHPI/poseidon/internal/nomad"
"github.com/openHPI/poseidon/pkg/dto"
"github.com/openHPI/poseidon/pkg/logging"
"github.com/openHPI/poseidon/pkg/nullio"
"github.com/openHPI/poseidon/pkg/storage"
"github.com/openHPI/poseidon/tests"
@@ -403,6 +404,6 @@ func NewRunner(id string, manager Accessor) Runner {
func (s *UpdateFileSystemTestSuite) TestGetFileContentReturnsErrorIfExitCodeIsNotZero() {
s.mockedExecuteCommandCall.RunFn = nil
s.mockedExecuteCommandCall.Return(1, nil)
err := s.runner.GetFileContent("", &bytes.Buffer{}, false, context.Background())
err := s.runner.GetFileContent("", logging.NewLoggingResponseWriter(nil), false, context.Background())
s.ErrorIs(err, ErrFileNotFound)
}