Skip to content

feat: support HTTP URLs in Network Mock Settings#361

Merged
srtvprateek merged 1 commit intoandroidPluto:developfrom
amary21:feat/support-http
May 1, 2026
Merged

feat: support HTTP URLs in Network Mock Settings#361
srtvprateek merged 1 commit intoandroidPluto:developfrom
amary21:feat/support-http

Conversation

@amary21
Copy link
Copy Markdown
Contributor

@amary21 amary21 commented May 1, 2026

Description

This Pull Request introduces support for http:// URLs in the Network Mocking feature. Previously, the validation logic was restricted to https:// URLs only, which limited developers when testing against local development servers or non-secure staging environments.

Changes

  • Updated MockSettingsViewModel.kt validation logic to permit both http and https protocols using URLUtil.
  • Updated the UI error message to inform users that both http:// and https:// prefixes are now valid.

Technical Note: Cleartext Traffic (Debugging Only)

If you encounter a Cleartext HTTP traffic not permitted error while using http URLs (standard behavior on Android 9+), you can temporarily allow it by adding the following attribute to your AndroidManifest.xml:

<application
    android:usesCleartextTraffic="true"
    ...>
</application>

IMPORTANT

Security Warning: The usesCleartextTraffic attribute should ONLY be used for debugging and local testing. Do not enable this in production as it allows unencrypted network traffic, which poses a significant security risk.

Checklist

  • Supports http:// URLs
  • Supports https:// URLs
  • Updated validation error messages

* Updated validation to accept both http and https URLs
* Improved error message for invalid URL protocols
@srtvprateek srtvprateek merged commit aed741d into androidPluto:develop May 1, 2026
5 checks passed
@amary21 amary21 deleted the feat/support-http branch May 2, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants