瀏覽代碼

Backport PR #11852: Add percent decoding to `username` (#11865)

Frédéric Collonval 3 年之前
父節點
當前提交
831fdadd50
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/docprovider/src/yprovider.ts

+ 3 - 1
packages/docprovider/src/yprovider.ts

@@ -43,7 +43,9 @@ export class WebSocketProviderWithLocks
     this._contentType = options.contentType;
     this._serverUrl = options.url;
     const color = '#' + env.getParam('--usercolor', getRandomColor().slice(1));
-    const name = env.getParam('--username', getAnonymousUserName());
+    const name = decodeURIComponent(
+      env.getParam('--username', getAnonymousUserName())
+    );
     const awareness = options.ymodel.awareness;
     const currState = awareness.getLocalState();
     // only set if this was not already set by another plugin