Skip to content

fix(sample): accept localhost host:port in internal settings URL validation#760

Draft
mahmoud-elmorabea wants to merge 3 commits into
mainfrom
fix-internal-settings-localhost-url-validation
Draft

fix(sample): accept localhost host:port in internal settings URL validation#760
mahmoud-elmorabea wants to merge 3 commits into
mainfrom
fix-internal-settings-localhost-url-validation

Conversation

@mahmoud-elmorabea

Copy link
Copy Markdown
Contributor

Fixes the internal settings screen rejecting localhost:8080 (and IP) host:port values as invalid API/CDN host URLs. Uri.parse treats the host before the colon as a scheme, so the validator flagged it; we now detect a real scheme via :// instead.

🤖 Generated with Claude Code

…dation

Uri.parse treats the host in "localhost:8080" as a scheme, so the
internal settings validator rejected localhost (and IP) host:port
values. Detect a real scheme via "://" instead of getScheme().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.49%. Comparing base (b5cf24d) to head (71438ff).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
.../customer/sdk/core/network/CustomerIOHttpClient.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #760      +/-   ##
============================================
- Coverage     69.07%   68.49%   -0.58%     
- Complexity      838      898      +60     
============================================
  Files           149      159      +10     
  Lines          4601     4920     +319     
  Branches        628      661      +33     
============================================
+ Hits           3178     3370     +192     
- Misses         1189     1304     +115     
- Partials        234      246      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
  • kotlin_compose: fix-internal-settings-localhost-url-validation (1782755477)

@github-actions

Copy link
Copy Markdown
  • java_layout: fix-internal-settings-localhost-url-validation (1782755491)

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

📏 SDK Binary Size Comparison Report

Module Last Recorded Size Current Size Change in Size
core 33.61 KB 33.64 KB ⬆️ +0.03KB
datapipelines 42.42 KB 43.02 KB ⬆️ +0.60KB
messagingpush 31.67 KB 31.67 KB ✅ No Change
messaginginapp 120.83 KB 120.83 KB ✅ No Change
tracking-migration 22.89 KB 22.89 KB ✅ No Change

@github-actions

Copy link
Copy Markdown

Build available to test
Version: fix-internal-settings-localhost-url-validation-SNAPSHOT
Repository: https://central.sonatype.com/repository/maven-snapshots/

Both delivery paths hard-coded "https://" + host. Respect an explicit
http://|https:// scheme on the configured api/cdn host (default https
when absent) so non-production http endpoints can be used:
- core CustomerIOHttpClient uses the host as-is when it carries a scheme
- a SchemeAwareRequestFactory collapses Segment's forced https:// when the
  host already specifies one (covers event upload + settings fetch)
- sample internal settings validation accepts an optional http(s):// prefix

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
  • java_layout: fix-internal-settings-localhost-url-validation (1782814117)

@github-actions

Copy link
Copy Markdown
  • kotlin_compose: fix-internal-settings-localhost-url-validation (1782814124)

…onfig

Confirms updateAnalyticsConfig installs the factory on Configuration
(Segment builds its HTTPClient from configuration.requestFactory) and
that the doubled scheme collapses to the configured one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
  • java_layout: fix-internal-settings-localhost-url-validation (1782814798)

@github-actions

Copy link
Copy Markdown
  • kotlin_compose: fix-internal-settings-localhost-url-validation (1782814808)

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.

1 participant