Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/open_cups/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ def handle_question_submit() -> None:


def run() -> None:
headers = st.context.headers
ip_address = headers.get("X-Forwarded-For", "Unknown")
Copy link
Copy Markdown
Contributor

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-For correctly when it contains a list of IPs.

Many proxies send X-Forwarded-For as client-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.


st.write(f"Connecting from: {ip_address}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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()
Expand Down
Loading