Skip to content

bug: support absolute Location headers when polling long-running operations #20

@samzong

Description

@samzong

Problem

--wait polling assumes every Location header is a relative path. Many APIs return an absolute URL in Location, which currently gets concatenated with the selected hostname and produces an invalid request URL.

Evidence

  • pkg/runtime/build.go passes the raw Location header from a 202 Accepted response into PollUntilDone.
  • pkg/runtime/poll.go calls DoRawFull(ctx, hostname, "GET", location, ...) on each poll attempt.
  • pkg/runtime/client.go builds the request URL as base + path, so an absolute Location like https://api.example.com/jobs/1 becomes https://api.example.comhttps://api.example.com/jobs/1.
  • Existing poll tests only cover relative Location: /status.

Expected behavior

Polling should accept relative locations and same-host absolute URLs. Cross-host absolute URLs should either be rejected clearly or handled only under an explicit policy, so polling does not silently produce invalid URLs or unexpected outbound requests.

Verification

make test currently passes; current coverage does not include absolute Location headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions