Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
myhjmzy
code-server
提交
88cab271
C
code-server
项目概览
myhjmzy
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
88cab271
编写于
2月 28, 2020
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compress when sending client-side extension tars
上级
a8914b02
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
10 deletion
+22
-10
ci/vscode.patch
ci/vscode.patch
+7
-7
src/node/app/vscode.ts
src/node/app/vscode.ts
+1
-1
src/node/http.ts
src/node/http.ts
+14
-2
未找到文件。
ci/vscode.patch
浏览文件 @
88cab271
...
...
@@ -119,7 +119,7 @@ index 2d8b725ff2..a8d93a17ca 100644
unique-stream@^2.0.2:
version "2.2.1"
diff --git a/package.json b/package.json
index fde05321d2..
1a7ed2fa47
100644
index fde05321d2..
2427e7d4ae
100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,9 @@
...
...
@@ -128,7 +128,7 @@ index fde05321d2..1a7ed2fa47 100644
"dependencies": {
+ "@coder/logger": "^1.1.12",
+ "@coder/node-browser": "^1.0.8",
+ "@coder/requirefs": "^1.1.
4
",
+ "@coder/requirefs": "^1.1.
5
",
"applicationinsights": "1.0.8",
"chokidar": "3.2.3",
"graceful-fs": "4.1.11",
...
...
@@ -3109,7 +3109,7 @@ index 82626a55c7..5d3ee1b69b 100644
union-value@^1.0.0:
version "1.0.1"
diff --git a/yarn.lock b/yarn.lock
index a98533bad9..
19e94f8c4a
100644
index a98533bad9..
f4da0987c9
100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -140,6 +140,23 @@
...
...
@@ -3126,10 +3126,10 @@ index a98533bad9..19e94f8c4a 100644
+ resolved "https://registry.yarnpkg.com/@coder/node-browser/-/node-browser-1.0.8.tgz#c22f581b089ad7d95ad1362fd351c57b7fbc6e70"
+ integrity sha512-NLF9sYMRCN9WK1C224pHax1Cay3qKypg25BhVg7VfNbo3Cpa3daata8RF/rT8JK3lPsu8PmFgDRQjzGC9X1Lrw==
+
+"@coder/requirefs@^1.1.
4
":
+ version "1.1.
4
"
+ resolved "https://registry.yarnpkg.com/@coder/requirefs/-/requirefs-1.1.
4.tgz#ca59223a396021f2f606f71b833c43dbba06b10
b"
+ integrity sha512-
E+WB3Wvr31v7eqWdItBW4eVQ0tWr4iKH6qjzCMnRxTsbiiNzLgtDzRBYt/3KxnPrtWXXX6Fn02Ut933soZXJ+g
==
+"@coder/requirefs@^1.1.
5
":
+ version "1.1.
5
"
+ resolved "https://registry.yarnpkg.com/@coder/requirefs/-/requirefs-1.1.
5.tgz#259db370d563a79a96fb150bc9d69c7db6edc9f
b"
+ integrity sha512-
3jB47OFCql9+9FI6Vc4YX0cfFnG5rxBfrZUH45S4XYtYGOz+/Xl4h4d2iMk50b7veHkeSWGlB4VHC3UZ16zuYQ
==
+ optionalDependencies:
+ jszip "2.6.0"
+
...
...
src/node/app/vscode.ts
浏览文件 @
88cab271
...
...
@@ -174,7 +174,7 @@ export class VscodeHttpProvider extends HttpProvider {
break
case
"
/tar
"
:
if
(
typeof
route
.
query
.
path
===
"
string
"
)
{
return
this
.
getTarredResource
(
route
.
query
.
path
)
return
this
.
getTarredResource
(
r
equest
,
r
oute
.
query
.
path
)
}
break
case
"
/webview
"
:
...
...
src/node/http.ts
浏览文件 @
88cab271
...
...
@@ -11,6 +11,7 @@ import { Readable } from "stream"
import
*
as
tarFs
from
"
tar-fs
"
import
*
as
tls
from
"
tls
"
import
*
as
url
from
"
url
"
import
*
as
zlib
from
"
zlib
"
import
{
HttpCode
,
HttpError
}
from
"
../common/http
"
import
{
normalize
,
Options
,
plural
,
split
}
from
"
../common/util
"
import
{
SocketProxyProvider
}
from
"
./socket
"
...
...
@@ -222,9 +223,20 @@ export abstract class HttpProvider {
/**
* Tar up and stream a directory.
*/
protected
async
getTarredResource
(...
parts
:
string
[]):
Promise
<
HttpResponse
>
{
protected
async
getTarredResource
(
request
:
http
.
IncomingMessage
,
...
parts
:
string
[]):
Promise
<
HttpResponse
>
{
const
filePath
=
path
.
join
(...
parts
)
return
{
stream
:
tarFs
.
pack
(
filePath
),
filePath
,
mime
:
"
application/tar
"
,
cache
:
true
}
let
stream
:
Readable
=
tarFs
.
pack
(
filePath
)
const
headers
:
http
.
OutgoingHttpHeaders
=
{}
if
(
request
.
headers
[
"
accept-encoding
"
]
&&
request
.
headers
[
"
accept-encoding
"
].
includes
(
"
gzip
"
))
{
logger
.
debug
(
"
gzipping tar
"
,
field
(
"
filePath
"
,
filePath
))
const
compress
=
zlib
.
createGzip
()
stream
.
pipe
(
compress
)
stream
.
on
(
"
error
"
,
(
error
)
=>
compress
.
destroy
(
error
))
stream
.
on
(
"
close
"
,
()
=>
compress
.
end
())
stream
=
compress
headers
[
"
content-encoding
"
]
=
"
gzip
"
}
return
{
stream
,
filePath
,
mime
:
"
application/gzip
"
,
cache
:
true
,
headers
}
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录