conductor-oss/conductor · error · IllegalArgumentException

API spec redirect is missing a Location header

Error message

API spec redirect is missing a Location header

What it means

Error "API spec redirect is missing a Location header" thrown in conductor-oss/conductor.

Source

Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/ListApiToolsTask.java:259

    /** Follows a bounded redirect chain only after each destination passes the outbound policy. */
    private HttpResponse<byte[]> sendWithValidatedRedirects(String url, Map<String, String> headers)
            throws Exception {
        String currentUrl = url;
        for (int redirects = 0; redirects <= 5; redirects++) {
            HttpRequest.Builder request =
                    HttpRequest.newBuilder()
                            .uri(URI.create(currentUrl))
                            .timeout(REQUEST_TIMEOUT)
                            .GET();
            addHeaders(request, headers);
            HttpResponse<byte[]> response =
                    httpClient.send(request.build(), HttpResponse.BodyHandlers.ofByteArray());
            if (response.statusCode() < 300 || response.statusCode() >= 400) {
                return response;
            }
            String location = response.headers().firstValue("Location").orElse(null);
            if (location == null) {
                throw new IllegalArgumentException(
                        "API spec redirect is missing a Location header");
            }
            String target = URI.create(currentUrl).resolve(location).toString();
            if (hasSensitiveHeaders(headers) && !isSameOrigin(currentUrl, target)) {
                throw new IllegalArgumentException(
                        "Refusing to forward credentials across an API spec redirect");
            }
            currentUrl = target;
        }
        throw new IllegalArgumentException("API spec exceeded the redirect limit");
    }

    private void addHeaders(HttpRequest.Builder builder, Map<String, String> headers) {
        if (headers == null) {
            return;
        }
        headers.forEach(
                (name, value) -> {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Fix the spec server to return a Location header on redirects, or point the tool directly at the final URL.

When it happens

Trigger: Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/ListApiToolsTask.java:259 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/0e32ee04f439de24. Report an issue: GitHub.