-
-
Notifications
You must be signed in to change notification settings - Fork 1
X-Forwarded-For #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
X-Forwarded-For #175
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,6 +257,10 @@ def handle_question_submit() -> None: | |
|
|
||
|
|
||
| def run() -> None: | ||
| headers = st.context.headers | ||
| ip_address = headers.get("X-Forwarded-For", "Unknown") | ||
|
|
||
| st.write(f"Connecting from: {ip_address}") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 question (security): Double-check whether exposing the client IP in the UI aligns with privacy/user expectations. Depending on your context, this could be treated as sensitive information. If it’s mainly for diagnostics, consider hiding it behind a debug flag or limiting visibility to admin/privileged users. |
||
| st_autorefresh(interval=AUTOREFRESH_INTERVAL_MS, key="data_refresh") | ||
|
|
||
| state_provider = StateProvider() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider parsing
X-Forwarded-Forcorrectly when it contains a list of IPs.Many proxies send
X-Forwarded-Forasclient-ip, proxy1, proxy2, .... Using it directly may log the whole chain instead of the client IP. If you want the originating client IP, split on","and use the first trimmed entry.