Skip to content

Commit a644ab3

Browse files
committed
urlencode label name when deleting
Spaces are legal in label names, but get errors if they're not escaped. This feels like a responsibility of the thing constructing URLs, but I can understand if it should actually be the caller's responsibility.
1 parent 5afadcd commit a644ab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/issues.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ impl IssueHandler<'_> {
480480
/// # }
481481
/// ```
482482
pub async fn delete_label(&self, name: impl AsRef<str>) -> Result<()> {
483-
let route = format!("/{}/labels/{name}", self.repo, name = name.as_ref(),);
483+
let route = format!("/{}/labels/{name}", self.repo, name = utf8_percent_encode(name.as_ref(), NON_ALPHANUMERIC));
484484

485485
self.crab._delete(route, None::<&()>).await?;
486486
Ok(())

0 commit comments

Comments
 (0)