rubberduckies
rubberduckies
Explore posts from servers
HHono
Created by rubberduckies on 6/29/2024 in #help
middleware redirect from HTTPS to HTTP
thank you
5 replies
HHono
Created by rubberduckies on 6/29/2024 in #help
middleware redirect from HTTPS to HTTP
i'll look into it
5 replies
HHono
Created by rubberduckies on 6/29/2024 in #help
middleware redirect from HTTPS to HTTP
[UPDATE]: In the meantime, i realized i don't even have to make the redirects on ajax calls, as i can get the query string from referer, but my question still stands...
export const orgAndWebsiteMiddleware = async (c, next) => {
const { user, token } = c.var;
const referrer = c.req.header('referer');
const referrerUrl = referrer && new URL(c.req.header('referer'));
const org = c.req.query('org') || referrerUrl?.searchParams.get('org');
const ws = c.req.query('ws') || referrerUrl?.searchParams.get('ws');
...
}
export const orgAndWebsiteMiddleware = async (c, next) => {
const { user, token } = c.var;
const referrer = c.req.header('referer');
const referrerUrl = referrer && new URL(c.req.header('referer'));
const org = c.req.query('org') || referrerUrl?.searchParams.get('org');
const ws = c.req.query('ws') || referrerUrl?.searchParams.get('ws');
...
}
5 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
than you so much
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
that would be great
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
No description
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
No description
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
No description
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
this is also working...
app.get('/', (c) => {
const posted = getCookie(c, 'posted');
if (posted) return c.html(<h1>Posted</h1>);

return c.html(
<form method="POST">
<button type="submit">Submit</button>
</form>,
);
});

app.post('/', (c) => {
setCookie(c, 'posted', 'true');
return c.redirect('/');
});
app.get('/', (c) => {
const posted = getCookie(c, 'posted');
if (posted) return c.html(<h1>Posted</h1>);

return c.html(
<form method="POST">
<button type="submit">Submit</button>
</form>,
);
});

app.post('/', (c) => {
setCookie(c, 'posted', 'true');
return c.redirect('/');
});
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
with this, still working:
app.post('/', (c) => {
return c.redirect('/');
});
app.post('/', (c) => {
return c.redirect('/');
});
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
import { Hono } from 'hono';

const { ADMIN_PORT: PORT } = process.env;
const app = new Hono();

Bun.serve({
port: PORT,
reload: true,
fetch: app.fetch,
});

app.get('/', (c) => {
return c.html(
<form method="POST">
<button type="submit">Submit</button>
</form>,
);
});

app.post('/', (c) => {
return c.html(<h1>POSTED</h1>);
});

console.log('Admin app running on port', PORT);
import { Hono } from 'hono';

const { ADMIN_PORT: PORT } = process.env;
const app = new Hono();

Bun.serve({
port: PORT,
reload: true,
fetch: app.fetch,
});

app.get('/', (c) => {
return c.html(
<form method="POST">
<button type="submit">Submit</button>
</form>,
);
});

app.post('/', (c) => {
return c.html(<h1>POSTED</h1>);
});

console.log('Admin app running on port', PORT);
this is the simplest form, and it is working on safari also
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
give me a sec
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
i'm going to do something better
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
but i also tried with a fetch (using HTMX) and the result is the same
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
posting directly
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
No description
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
<form class="mt-5 grid gap-2 lg:gap-8" method="POST">
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
oh i'll try that then
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
so it did pass that obstacle, but in the end, the result was the same, nothing goes to the browser
57 replies
HHono
Created by rubberduckies on 6/26/2024 in #help
Problems with Form POST in Safari and IOS
and just had const email = 'email'; const password = 'password'
57 replies