You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We run Capacitor with the Http plugin patching enabled. We are using the HTML base element in the app to specify a server URL like this: <base href="https://www.example.com/" />
Yesterday we ran into a problem with a view implemented in HTMX where it made an AJAX request to the path /some/view. The request was then served by the browser rather than via CapacitorHttp, which led to CORS issues when the request was sent to https://www.example.com/some/view. The reason is that Capacitor sees this as a relative path and calls the unpatched method.
I'm not sure if the problem here is that HTMX should have looked at the base-tag and added it to the URL before making an AJAX call, or if Capacitor is naive because it assumes that any URL that does not start with http will not be sent to a remote server? Is this a Capacitor bug, or could it at least be documented better?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We run Capacitor with the Http plugin patching enabled. We are using the HTML base element in the app to specify a server URL like this:
<base href="https://www.example.com/" />
Yesterday we ran into a problem with a view implemented in HTMX where it made an AJAX request to the path
/some/view
. The request was then served by the browser rather than via CapacitorHttp, which led to CORS issues when the request was sent tohttps://www.example.com/some/view
. The reason is that Capacitor sees this as a relative path and calls the unpatched method.I'm not sure if the problem here is that HTMX should have looked at the base-tag and added it to the URL before making an AJAX call, or if Capacitor is naive because it assumes that any URL that does not start with
http
will not be sent to a remote server? Is this a Capacitor bug, or could it at least be documented better?Beta Was this translation helpful? Give feedback.
All reactions