AnswerDotAI / AnswerDotAI/fasthtml

[BUG] https/http issue with unpkg.com

Open
#697 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
7k
Forks
319
Avg merge
28m
Merged PRs (30d)
3

Description

In core.py is
` htmxsrc = Script(src="https://unpkg.com/htmx.org@next/dist/htmx.min.js")`

however, unpkg.com does a redirect via http, which causes this request to be blocked in some browsers;(

```
curl -v "https://unpkg.com/htmx.org@next/dist/htmx.min.js"
* Host unpkg.com:443 was resolved.
* IPv6: (none)
* IPv4: 104.17.247.203, 104.17.245.203, 104.17.248.203, 104.17.249.203, 104.17.246.203
* Trying 104.17.247.203:443...
* Connected to unpkg.com (104.17.247.203) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
* subject: CN=unpkg.com
* start date: Mar 20 17:47:13 2025 GMT
* expire date: Jun 18 18:47:11 2025 GMT
* subjectAltName: host "unpkg.com" matched cert's "unpkg.com"
* issuer: C=US; O=Google Trust Services; CN=WE1
* SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://unpkg.com/htmx.org@next/dist/htmx.min.js
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: unpkg.com]
* [HTTP/2] [1] [:path: /htmx.org@next/dist/htmx.min.js]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
> GET /htmx.org@next/dist/htmx.min.js HTTP/2
> Host: unpkg.com
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/2 302
< date: Mon, 31 Mar 2025 09:58:16 GMT
< content-type: text/plain;charset=UTF-8
< location: http://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js
< access-control-allow-origin: *
< cross-origin-resource-policy: cross-origin
< via: 1.1 fly.io, 1.1 fly.io
< fly-request-id: 01JQNQ9MJX3ATEA3675BNPX8Q0-waw
< cf-cache-status: STALE
< age: 3016
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 928efc600a11bf2d-WAW
< alt-svc: h3=":443"; ma=86400
<
* Connection #0 to host unpkg.com left intact
Redirecting to http://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js%
```

Direct link "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js" helps.
I have been observing many problems with unpkg.com, they load files very slowly.
I would appreciate the ability to serve all required dependencies myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.