Comments (7)
@freddyaboulton thanks for taking a look
this line only populates the share editor blocks; the iframe was accessed through HTTPS
if hf_space_host: iframe_src = f"https://{hf_space_host}/q?query_id={query_id}"
The MixedContent problem was due to a RedirectResponse (commented out in the very end). Initially the landing page (the /
route) was redirecting to a /sql
endpoint. Looking through the dev tools / network panel, I could see that one of the calls during a redirect was over HTTP. I did not save the screenshot, but it was happening with this commit (I tried setting the proto header too).
In the end, I fixed it by mounting the gradio app to /
and handling the absent query parameters to create a functional equivalent of a redirect.
from gradio.
Hi @LeXwDeX , can you try setting the x-forwarded-proto
header to https
?
from gradio.
Hi @LeXwDeX , can you try setting the
x-forwarded-proto
header tohttps
?
Oh my God, After adding this header, it works.
conf snippet now:
location / {
proxy_pass http://localhost:7860;
proxy_set_header X-Forwarded-Proto $scheme;
from gradio.
I have something possibly related going on...
My app in HF spaces it is complaining about insecure iframes.
index.js:1 Mixed Content: The page at 'https://huggingface.co/spaces/liquidcarbon/duckdb-fastapi-gradio' was loaded over HTTPS, but requested an insecure frame 'http://liquidcarbon-duckdb-fastapi-gradio.hf.space/sql/?alias=example1'. This request has been blocked; the content must be served over HTTPS.
It works locally, in container, and when started from
http://liquidcarbon-duckdb-fastapi-gradio.hf.space/sql/?alias=example1
but not from
https://huggingface.co/spaces/liquidcarbon/duckdb-fastapi-gradio
it's likely from my RedirectResponse to another endpoint from the landing page; I tried setting the header but it did not work.
https://huggingface.co/spaces/liquidcarbon/duckdb-fastapi-gradio/blob/main/main.py#L167
from gradio.
I think the issue is the iframe needs to be accessed over https here: https://huggingface.co/spaces/liquidcarbon/duckdb-fastapi-gradio/blob/89caffe982f0742877cc00729a925c1aa60a5ba7/main.py#L133
from gradio.
Glad you found the issue! Seems like a bug with the RedirectResponse
class then?
from gradio.
I'm not sure! Starlette/FastAPI RedirectResponse doesn't concern itself with http/https directly, as far as I understand.
I think it's something with HF spaces internals. The app itself is served in an iframe, and something in there is not handling redirects properly.
If you do "view page source" on the main app page, https://huggingface.co/spaces/liquidcarbon/duckdb-fastapi-gradio
-- <iframe src="https://liquidcarbon-duckdb-fastapi-gradio.hf.space/" aria-label="Space app" class=" space-iframe flex-grow overflow-hidden bg-white p-0 outline-none dark:bg-white" allow="accelerometer; ambient-light-sensor; autoplay; battery; camera; clipboard-read; clipboard-write; display-capture; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking" sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-storage-access-by-user-activation" scrolling="no"></iframe> |from gradio.
Related Issues (20)
- Unable to programatically update gr.Examples
- CSS can't load in localhost when using asymetric port mapping with docker and nginx reverse proxy HOT 2
- Unable to reference TextBox when loading HF Space with gr.load.
- Z-index issue with loading bar
- AttributeError: 'Image' object has no attribute 'value' HOT 2
- Streaming complex object fast in custom component makes bug HOT 5
- Custom values are not supported when 'multiselect' is True ? HOT 1
- Speech to text output text box issue HOT 2
- Unable to run custom component dev server based on DataFrame template HOT 3
- `gr.load()` does not work inside `gr.Blocks` HOT 2
- Return of older bug. Cannot update Dataset
- ConnectionResetError: [WinError 10054] when click radio to switch HOT 3
- Drag-and-Drop Image doesn't work inside of a `gr.Tab` HOT 1
- Gradio has a conflict with Python file cp1252 HOT 3
- Gradio-Lite : zero-shot-classification pipeline returns only 1 score HOT 2
- Be able to generate random samples in `gr.Examples` or `examples` in `gr.ChatInterface` HOT 2
- `Edge` runtime compatable javascript client or REST API docs HOT 1
- cannot import name 'JsonValue' from 'pydantic' HOT 5
- Clarity needed for cli tool \ custom component development HOT 4
- how can i make button upper than the component it controls. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.