Skip to content

Commit 689b2d6

Browse files
authored
Revert my cheeky change (#1799)
1 parent 735d963 commit 689b2d6

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/wshrpc/wshremote/wshremote.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,25 @@ func (impl *ServerImpl) remoteStreamFileInternal(ctx context.Context, data wshrp
162162
if err != nil {
163163
return err
164164
}
165-
finfo, err := impl.fileInfoInternal(data.Path, true)
165+
path, err := wavebase.ExpandHomeDir(data.Path)
166166
if err != nil {
167-
return fmt.Errorf("cannot stat file %q: %w", data.Path, err)
167+
return err
168+
}
169+
finfo, err := impl.fileInfoInternal(path, true)
170+
if err != nil {
171+
return fmt.Errorf("cannot stat file %q: %w", path, err)
168172
}
169173
dataCallback([]*wshrpc.FileInfo{finfo}, nil, byteRange)
170174
if finfo.NotFound {
171175
return nil
172176
}
173177
if finfo.Size > wshrpc.MaxFileSize {
174-
return fmt.Errorf("file %q is too large to read, use /wave/stream-file", finfo.Path)
178+
return fmt.Errorf("file %q is too large to read, use /wave/stream-file", path)
175179
}
176180
if finfo.IsDir {
177-
return impl.remoteStreamFileDir(ctx, finfo.Path, byteRange, dataCallback)
181+
return impl.remoteStreamFileDir(ctx, path, byteRange, dataCallback)
178182
} else {
179-
return impl.remoteStreamFileRegular(ctx, finfo.Path, byteRange, dataCallback)
183+
return impl.remoteStreamFileRegular(ctx, path, byteRange, dataCallback)
180184
}
181185
}
182186

0 commit comments

Comments
 (0)