Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -40,6 +40,7 @@
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;
import hudson.remoting.VirtualChannel;
import hudson.Util;
import hudson.util.FormValidation;
import java.io.IOException;
import java.net.HttpURLConnection;
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