Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Coder
code-server
提交
eccee531
C
code-server
项目概览
镜像
/
Coder
/
code-server
2022-09-21 03:15:05同步失败
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
eccee531
编写于
5月 18, 2020
作者:
A
Anmol Sethi
提交者:
GitHub
5月 18, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1670 from cdr/windows
Fix paths from Windows client to non-Windows server
上级
0c2381f4
f7f11ad6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
9 deletion
+57
-9
ci/dev/vscode.patch
ci/dev/vscode.patch
+5
-7
src/node/app/static.ts
src/node/app/static.ts
+2
-1
src/node/app/vscode.ts
src/node/app/vscode.ts
+2
-1
src/node/util.ts
src/node/util.ts
+48
-0
未找到文件。
ci/dev/vscode.patch
浏览文件 @
eccee531
...
...
@@ -248,19 +248,17 @@ index 1e16cde724..0000000000
-target "12.4.0"
-runtime "node"
diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts
index e4546b2cf6..
9df12239fb
100644
index e4546b2cf6..
ad2c544e89
100644
--- a/src/vs/base/common/network.ts
+++ b/src/vs/base/common/network.ts
@@ -94,16 +94,1
8
@@
class RemoteAuthoritiesImpl {
@@ -94,16 +94,1
7
@@
class RemoteAuthoritiesImpl {
if (host && host.indexOf(':') !== -1) {
host = `[${host}]`;
}
- const port = this._ports[authority];
+ // const port = this._ports[authority];
const connectionToken = this._connectionTokens[authority];
- let query = `path=${encodeURIComponent(uri.path)}`;
+ // NOTE@coder: Use fsPath for Windows support.
+ let query = `path=${encodeURIComponent(uri.fsPath)}`;
let query = `path=${encodeURIComponent(uri.path)}`;
if (typeof connectionToken === 'string') {
query += `&tkn=${encodeURIComponent(connectionToken)}`;
}
...
...
@@ -1067,7 +1065,7 @@ index 0000000000..0d2e93edae
+}
diff --git a/src/vs/server/browser/worker.ts b/src/vs/server/browser/worker.ts
new file mode 100644
index 0000000000..
8db1e17c38
index 0000000000..
a93381631a
--- /dev/null
+++ b/src/vs/server/browser/worker.ts
@@ -0,0 +1,57 @@
...
...
@@ -1090,7 +1088,7 @@ index 0000000000..8db1e17c38
+ scheme: self.location.protocol.replace(':', ''),
+ authority: self.location.host,
+ path: self.location.pathname.replace(/\/static\/([^\/]+)\/.*$/, '/static/$1\/'),
+ query: `tar=${encodeURIComponent(module.extensionLocation.
fsP
ath)}`,
+ query: `tar=${encodeURIComponent(module.extensionLocation.
p
ath)}`,
+ });
+ const response = await fetch(fetchUri.toString(true));
+ if (response.status !== 200) {
...
...
src/node/app/static.ts
浏览文件 @
eccee531
...
...
@@ -5,6 +5,7 @@ import { Readable } from "stream"
import
*
as
tarFs
from
"
tar-fs
"
import
*
as
zlib
from
"
zlib
"
import
{
HttpProvider
,
HttpResponse
,
Route
}
from
"
../http
"
import
{
pathToFsPath
}
from
"
../util
"
/**
* Static file HTTP provider. Regular static requests (the path is the request
...
...
@@ -18,7 +19,7 @@ export class StaticHttpProvider extends HttpProvider {
if
(
typeof
route
.
query
.
tar
===
"
string
"
)
{
this
.
ensureAuthenticated
(
request
)
return
this
.
getTarredResource
(
request
,
route
.
query
.
tar
)
return
this
.
getTarredResource
(
request
,
pathToFsPath
(
route
.
query
.
tar
)
)
}
const
response
=
await
this
.
getReplacedResource
(
route
)
...
...
src/node/app/vscode.ts
浏览文件 @
eccee531
...
...
@@ -18,6 +18,7 @@ import { generateUuid } from "../../common/util"
import
{
Args
}
from
"
../cli
"
import
{
HttpProvider
,
HttpProviderOptions
,
HttpResponse
,
Route
}
from
"
../http
"
import
{
settings
}
from
"
../settings
"
import
{
pathToFsPath
}
from
"
../util
"
export
class
VscodeHttpProvider
extends
HttpProvider
{
private
readonly
serverRootPath
:
string
...
...
@@ -151,7 +152,7 @@ export class VscodeHttpProvider extends HttpProvider {
case
"
/resource
"
:
case
"
/vscode-remote-resource
"
:
if
(
typeof
route
.
query
.
path
===
"
string
"
)
{
return
this
.
getResource
(
route
.
query
.
path
)
return
this
.
getResource
(
pathToFsPath
(
route
.
query
.
path
)
)
}
break
case
"
/webview
"
:
...
...
src/node/util.ts
浏览文件 @
eccee531
...
...
@@ -217,3 +217,51 @@ export function extend(...args: any[]): any {
}
return
c
}
/**
* Taken from vs/base/common/charCode.ts. Copied for now instead of importing so
* we don't have to set up a `vs` alias to be able to import with types (since
* the alternative is to directly import from `out`).
*/
const
enum
CharCode
{
Slash
=
47
,
A
=
65
,
Z
=
90
,
a
=
97
,
z
=
122
,
Colon
=
58
,
}
/**
* Compute `fsPath` for the given uri.
* Taken from vs/base/common/uri.ts. It's not imported to avoid also importing
* everything that file imports.
*/
export
function
pathToFsPath
(
path
:
string
,
keepDriveLetterCasing
=
false
):
string
{
const
isWindows
=
process
.
platform
===
"
win32
"
const
uri
=
{
authority
:
undefined
,
path
,
scheme
:
"
file
"
}
let
value
:
string
if
(
uri
.
authority
&&
uri
.
path
.
length
>
1
&&
uri
.
scheme
===
"
file
"
)
{
// unc path: file://shares/c$/far/boo
value
=
`//
${
uri
.
authority
}${
uri
.
path
}
`
}
else
if
(
uri
.
path
.
charCodeAt
(
0
)
===
CharCode
.
Slash
&&
((
uri
.
path
.
charCodeAt
(
1
)
>=
CharCode
.
A
&&
uri
.
path
.
charCodeAt
(
1
)
<=
CharCode
.
Z
)
||
(
uri
.
path
.
charCodeAt
(
1
)
>=
CharCode
.
a
&&
uri
.
path
.
charCodeAt
(
1
)
<=
CharCode
.
z
))
&&
uri
.
path
.
charCodeAt
(
2
)
===
CharCode
.
Colon
)
{
if
(
!
keepDriveLetterCasing
)
{
// windows drive letter: file:///c:/far/boo
value
=
uri
.
path
[
1
].
toLowerCase
()
+
uri
.
path
.
substr
(
2
)
}
else
{
value
=
uri
.
path
.
substr
(
1
)
}
}
else
{
// other path
value
=
uri
.
path
}
if
(
isWindows
)
{
value
=
value
.
replace
(
/
\/
/g
,
"
\\
"
)
}
return
value
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录