소스 검색

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}`],