Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post method fails with error 400 if we are posting config.xml to an inheritance project #52

Open
dprajasekhar opened this issue Dec 31, 2017 · 1 comment

Comments

@dprajasekhar
Copy link

Hello ,

There is a plugin called jenkins "build-per-branch ", which clones the master job and creates clone for the branches in the given git repository . As part of this the plugin does

  1. Copy the job from the current to a new job
  2. Update the branch details and in place of current through post method

However post method fails with httpcode 400 when there is an inheritance project . Looking at the code I think the following snippet in InhertiProject.java throws the error

	if (req.getMethod().equals("POST")) {
		super.doConfigDotXml(req, rsp);
	}
	if (!req.getMethod().equals("GET")) {
		//Huh? Only GET/POST make sense
		rsp.sendError(SC_BAD_REQUEST);
	}

If the http method is post , I think we should proceed instead of sending 400 error . Please correct me if I am wrong in this assumption

@dprajasekhar
Copy link
Author

Exception trace is

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:668)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:737)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant