#222 - Encode branch name on requests to avoid errors with special chars
This commit is contained in:
parent
679634afec
commit
471b26a9d5
@ -331,20 +331,20 @@ export default class API {
|
|||||||
}
|
}
|
||||||
|
|
||||||
patchRef(type, name, sha) {
|
patchRef(type, name, sha) {
|
||||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ name }`, {
|
return this.request(`${ this.repoURL }/git/refs/${ type }/${ encodeURIComponent(name) }`, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
body: JSON.stringify({ sha }),
|
body: JSON.stringify({ sha }),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteRef(type, name, sha) {
|
deleteRef(type, name, sha) {
|
||||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ name }`, {
|
return this.request(`${ this.repoURL }/git/refs/${ type }/${ encodeURIComponent(name) }`, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getBranch(branch = this.branch) {
|
getBranch(branch = this.branch) {
|
||||||
return this.request(`${ this.repoURL }/branches/${ branch }`);
|
return this.request(`${ this.repoURL }/branches/${ encodeURIComponent(branch) }`);
|
||||||
}
|
}
|
||||||
|
|
||||||
createBranch(branchName, sha) {
|
createBranch(branchName, sha) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user