Skip to content

fix(curl): skip JSON schema conversion for internal/localhost URLs#1172

Merged
FlorianBruniaux merged 1 commit intortk-ai:developfrom
iRonin:fix/curl-json-schema-values
Apr 13, 2026
Merged

fix(curl): skip JSON schema conversion for internal/localhost URLs#1172
FlorianBruniaux merged 1 commit intortk-ai:developfrom
iRonin:fix/curl-json-schema-values

Conversation

@iRonin
Copy link
Copy Markdown
Contributor

@iRonin iRonin commented Apr 10, 2026

Summary

Fixes issues #1152 and #1157: JSON schema conversion was destroying values for internal/localhost URLs.

Problem

The curl JSON schema filter converts response bodies into type schemas, which destroys the actual values. For internal URLs (localhost, 127.0.0.1, etc.) this is problematic because:

  • Chrome DevTools Protocol responses get schema-converted instead of showing actual browser info
  • Internal API responses lose their values
  • Local development tools get broken output

Solution

Added is_internal_url() helper that detects localhost/127.0.0.1/[::1] URLs. When an internal URL is detected, the JSON schema conversion is skipped, preserving the original JSON values.

Changes

  • Add is_internal_url() function to detect internal URLs
  • Guard JSON schema conversion behind !is_internal_url(args) check
  • Update filter_curl_output signature to accept args
  • Add test_is_internal_url_localhost test
  • Update existing tests to pass empty args

@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal labels Apr 10, 2026
@pszymkowiak
Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Adds an is_internal_url() helper to detect localhost/127.0.0.1/[::1] URLs and skips JSON schema conversion for those URLs, preserving original response values. This fixes cases where internal tool responses (e.g., Chrome DevTools Protocol) were having their values destroyed by the schema filter.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1152, #1157


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@iRonin iRonin force-pushed the fix/curl-json-schema-values branch from a839d59 to 577c311 Compare April 10, 2026 17:54
Copy link
Copy Markdown
Collaborator

@FlorianBruniaux FlorianBruniaux left a comment

Choose a reason for hiding this comment

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

LGTM — security fix, reviewed diff, tests pass.

@FlorianBruniaux FlorianBruniaux merged commit 3223c76 into rtk-ai:develop Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants