瀏覽代碼

percent encode # character

Gildas 4 年之前
父節點
當前提交
c019eff9bb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      extension/lib/github/github.js

+ 1 - 1
extension/lib/github/github.js

@@ -46,7 +46,7 @@ async function pushGitHub(token, userName, repositoryName, branchName, path, con
 
 	async function createContent({ path, content, message = "" }, signal) {
 		try {
-			const response = await fetch(`https://api.github.com/repos/${userName}/${repositoryName}/contents/${path}`, {
+			const response = await fetch(`https://api.github.com/repos/${userName}/${repositoryName}/contents/${path.replace(/#/g, "%23")}`, {
 				method: "PUT",
 				headers: new Map([
 					["Authorization", `token ${token}`],