提交 5c6a0989 编写于 作者: J Jesse Glick

Merged #1595 and enabled test.

......@@ -208,7 +208,7 @@ public class Api extends AbstractModelObject {
public void doJson(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (req.getParameter("jsonp") == null || permit(req)) {
setHeaders(rsp);
rsp.serveExposedBean(req,bean, Flavor.JSON);
rsp.serveExposedBean(req,bean, req.getParameter("jsonp") == null ? Flavor.JSON : Flavor.JSONP);
} else {
rsp.sendError(HttpURLConnection.HTTP_FORBIDDEN, "jsonp forbidden; implement jenkins.security.SecureRequester");
}
......
......@@ -29,7 +29,6 @@ import com.gargoylesoftware.htmlunit.Page;
import java.io.File;
import java.net.HttpURLConnection;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
......@@ -50,7 +49,6 @@ public class ApiTest {
j.createWebClient().goTo("api/xml?xpath=/*[1]", "application/xml");
}
@Ignore("TODO currently serves application/json")
@Issue("JENKINS-27607")
@Test public void json() throws Exception {
FreeStyleProject p = j.createFreeStyleProject("p");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册