safely detect global IPv4 and close socket properly and Harden get_subscription_payload against malformed tokens - #21
Closed
zZedix wants to merge 7 commits into
Closed
safely detect global IPv4 and close socket properly and Harden get_subscription_payload against malformed tokens#21zZedix wants to merge 7 commits into
zZedix wants to merge 7 commits into
Conversation
- اضافه کردن لوگوی PasarGuard - بهبود طراحی بصری با ایموجیها و جداول - ترجمه کامل به فارسی و انگلیسی - ساختار بهتر و خوانایی بیشتر - اضافه کردن بخشهای جدید و بهبود یافته
- حل تضاد merge در README.md - نگهداری نسخه بهبود یافته با لوگو و طراحی زیبا - حل تضاد در فایلهای utils
- Remove all Persian translations - Keep only English content - Maintain beautiful design and emojis - Clean and professional English documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve public IP detection with multiple HTTP and socket fallbacks
Add layered fallback strategy using ipify, icanhazip, and ifconfig.io with IPv4 enforcement.
Falls back to UDP socket check when HTTP methods fail, and defaults to 127.0.0.1.
Ensures IPv6 is disabled for reliability and includes proper socket cleanup.
Improves resilience of get_subscription_payload by validating decoded token format
and preventing IndexError/ValueError for tampered or malformed tokens.
Added split and numeric validation for custom token decoding
Ensures consistent None return instead of 500 on invalid input
Keeps behavior unchanged for valid subscription tokens