theonedev/onedev · warning · ExplicitException

Invalid request path

Error message

Invalid request path

What it means

CommitDetailPage parses the commit/revision segment (and indexed extra segments) from the URL into a revision range list. Because a range like 'a..b' is not a single commit, any segment containing '..' is rejected up front with ExplicitException('Invalid request path') to avoid ambiguity and path/range injection in commit URLs.

Source

Thrown at server-core/src/main/java/io/onedev/server/web/page/project/commits/CommitDetailPage.java:179

				@Override
				protected Collection<CodeComment> load() {
					CodeCommentService manager = OneDev.getInstance(CodeCommentService.class);
					return manager.query(projectModel.getObject(), getCompareWith(), resolvedRevision);
				}

			};

	private WebMarkupContainer refsContainer;
	
	private WebMarkupContainer revisionDiff;
	
	public CommitDetailPage(PageParameters params) {
		super(params);

		List<String> revisionSegments = new ArrayList<>();
		String segment = params.get(PARAM_COMMIT).toString();
		if (segment.contains(".."))
			throw new ExplicitException(_T("Invalid request path"));
		if (segment.length() != 0)
			revisionSegments.add(segment);
		for (int i=0; i<params.getIndexedCount(); i++) {
			segment = params.get(i).toString();
			if (segment.contains(".."))
				throw new ExplicitException(_T("Invalid request path"));
			if (segment.length() != 0)
				revisionSegments.add(segment);
		}

		if (revisionSegments.isEmpty())
			throw new RestartResponseException(ProjectCommitsPage.class, ProjectCommitsPage.paramsOf(getProject()));
		
		state = new State();
		state.revision = Joiner.on("/").join(revisionSegments);
		
		state.compareWith = params.get(PARAM_COMPARE_WITH).toString();
		state.whitespaceOption = WhitespaceOption.ofName(

View on GitHub (pinned to d44925c47c)

Solutions

  1. Use the compare page (RevisionComparePage / project 'Compare' URL) for ranges instead of the commit detail URL.
  2. Open a single commit hash in the commit detail URL: /~commits/<hash>.
  3. In integrations, validate the revision segment contains no '..' before building the URL.

Example fix

// before
GET /projects/app/~commits/main..feature  // range in commit URL
// after
GET /projects/app/~compare/main...feature
Defensive patterns

Strategy: validation

Validate before calling

if (revision == null || revision.contains("..")) {
    throw new IllegalArgumentException("Use compare page for ranges; commit URL accepts a single revision");
}

Type guard

static boolean isSingleRevision(String s) { return s != null && !s.contains("..") && !s.isBlank(); }

Try / catch

try {
    // navigate to commit detail
} catch (ExplicitException e) {
    // fall back to compare page for ranges
}

Prevention

When it happens

Trigger: Opening a commit detail URL whose PARAM_COMMIT segment contains '..' (e.g. /~commits/abc123..def456) instead of the compare page.

Common situations: Pasting a git range ('a..b') into a commit URL; a tool generating links with raw revision expressions; link built from user input containing dots.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/cb3257eec3cb9c21. Report an issue: GitHub.