Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/logging/LogRecorderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public HttpResponse doNewLogRecorder(@QueryParameter String name) {
recorders.add(new LogRecorder(name));

// redirect to the config screen
return new HttpRedirect(name + "/configure");
return new HttpRedirect(Util.rawEncode(name) + "/configure");
}

@Restricted(NoExternalUse.class)
Expand Down
14 changes: 14 additions & 0 deletions test/src/test/java/hudson/logging/LogRecorderManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import hudson.Util;
import hudson.XmlFile;
import hudson.model.Computer;
import hudson.model.Saveable;
Expand Down Expand Up @@ -130,6 +131,19 @@ void logRecorderCheckName() {
assertEquals(FormValidation.ok(), testRecorder.doCheckName("a", Level.OFF.getName()));
}

@Test
void createLogRecorderWithNonAsciiName() throws Exception {
String name = "Journal d’accès";

HtmlPage page = j.createWebClient().goTo("log/new");
HtmlForm form = page.getFormByName("configSubmit");
form.getInputByName("name").setValueAttribute(name);
j.submit(form);

assertNotNull(j.jenkins.getLog().getLogRecorder(name));
j.createWebClient().goTo("log/" + Util.rawEncode(name) + "/configure");
}

@Issue({"JENKINS-18274", "JENKINS-63458"})
@Test
void loggingOnSlaves() throws Exception {
Expand Down
Loading