WMK666666 commented on PR #29595:
URL: https://github.com/apache/camel/pull/29595#issuecomment-6801193045

   Both points are taken in 0e90f55.
   
   **The language check is gone.** @Croway is right: it rejected `iso:zh-Hant`, 
`script/Latin` and `eng+deu`,
   which docling accepts, and it applied to the `ocrLanguage` option too — 
`docling:convert?...&ocrLanguage=iso:de`
   worked before this PR and failed after it. That is a regression I 
introduced, thanks for catching it.
   
   @davsclaus — on the point that the value reaches the command unvalidated 
while `CamelDoclingCustomArguments`
   values are checked: the two are not the same shape. A custom argument can be 
a flag (`--to`, `--output`)
   that overrides a producer-managed option, or a path, which is why 
`validateCustomArguments` checks flags
   against an allowlist and paths for traversal. The language is neither. It is 
one element of the
   `List<String>` given to `ProcessBuilder`, so there is no shell and `;`, `|`, 
`$()` never reach an
   interpreter; and docling's own identifiers contain `:` (`iso:zh-Hant`), `/` 
(`script/Latin`, which
   `validatePathSafety` would reject as a path) and `+` (`eng+deu`). Any 
allowlist I could write cuts off valid
   input, so the value goes through untouched.
   
   The serve-path gap you raised is closed: `applyConfigurationToOptions` reads 
both headers, so
   `useDoclingServe=true` is no longer a silent no-op. The description now 
covers both paths.
   
   **Tests**: `DoclingOcrHeadersTest` adds 
`doclingLanguageIdentifiersReachTheCli` and
   `doclingLanguageIdentifiersReachTheServeRequest` (`iso:zh-Hant` on both 
paths) and keeps `en, de`. Putting
   the old check back fails exactly those two and leaves the other ten green.
   
   `mvn -pl components/camel-ai/camel-docling test`: 98 tests, 2 failures, both
   `DoclingCustomArgsValidationTest` on Windows (`/etc/cron.d` is not an 
absolute path there), the same two
   that fail without this change. `formatter:validate` and `impsort:check` pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to