[JENKINS-73801] Nested Views plugin overrides `View#doConfigDotXml(StaplerRequest)` (#9764)

This commit is contained in:
Basil Crow 2024-10-02 07:47:16 -07:00 committed by GitHub
parent 47a212aa79
commit 1c2b84cb76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -949,9 +949,28 @@ public abstract class View extends AbstractModelObject implements AccessControll
/** /**
* Accepts {@code config.xml} submission, as well as serve it. * Accepts {@code config.xml} submission, as well as serve it.
*
* @since 2.475
*/ */
@WebMethod(name = "config.xml") @WebMethod(name = "config.xml")
public HttpResponse doConfigDotXml(StaplerRequest2 req) throws IOException { public HttpResponse doConfigDotXml(StaplerRequest2 req) throws IOException {
if (Util.isOverridden(View.class, getClass(), "doConfigDotXml", StaplerRequest.class)) {
return doConfigDotXml(StaplerRequest.fromStaplerRequest2(req));
} else {
return doConfigDotXmlImpl(req);
}
}
/**
* @deprecated use {@link #doConfigDotXml(StaplerRequest2)}
*/
@Deprecated
@StaplerNotDispatchable
public HttpResponse doConfigDotXml(StaplerRequest req) throws IOException {
return doConfigDotXmlImpl(StaplerRequest.toStaplerRequest2(req));
}
private HttpResponse doConfigDotXmlImpl(StaplerRequest2 req) throws IOException {
if (req.getMethod().equals("GET")) { if (req.getMethod().equals("GET")) {
// read // read
checkPermission(READ); checkPermission(READ);