Skip to content

Conversation

@tcheeric
Copy link
Collaborator

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +59 to +62
private static URI buildUri(String baseUrl, String path) {
String normalizedBase = ensureScheme(baseUrl);
String normalizedPath = (path == null || path.isEmpty()) ? "/" : (path.startsWith("/") ? path : "/" + path);
return URI.create(normalizedBase).resolve(normalizedPath);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve base URL paths when resolving request URIs

The new buildUri always prefixes the supplied path with / and feeds it to URI.create(normalizedBase).resolve(normalizedPath). For base URLs that include a non-root path like https://example.com/api, resolve("/items") discards the /api prefix and produces https://example.com/items, whereas the previous baseUrl + path concatenation correctly yielded https://example.com/api/items. Deployments that rely on a path segment in phoenixd.base_url will now send every request to the wrong endpoint. Consider resolving a relative path (without the leading slash) or concatenating after normalizing the scheme so the base path is preserved.

Useful? React with 👍 / 👎.

@tcheeric tcheeric merged commit 6c02fde into develop Sep 13, 2025
3 of 4 checks passed
@tcheeric tcheeric deleted the fix/base-url-scheme-0.1.1 branch September 13, 2025 20:48
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

Successfully merging this pull request may close these issues.

2 participants