Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use / as base url instead of host addr in serve cmd #1169

Merged
merged 2 commits into from
Feb 28, 2024
Merged

use / as base url instead of host addr in serve cmd #1169

merged 2 commits into from
Feb 28, 2024

Conversation

jcbhmr
Copy link
Contributor

@jcbhmr jcbhmr commented Feb 23, 2024

Why? Tunneling! For example GitHub Codespaces will tunnel your port 1234 on your codespace's localhost to https://sometunnel-1234.githubcodespaces.example.org/. if you try to get http://localhost:1234/style.css then it fails since its not on localhost; its on a completely separate domain

ex:

<link rel=stylesheet href="{{ site.base_url }}/style.css">

This pr (hopefully) would fix that by turning the HTML from this:

<link rel=stylesheet href="http://localhost:1234/style.css">

into this which works across localhost and tunnels

<link rel=stylesheet href="/style.css">

@jcbhmr jcbhmr changed the title use / as base url instead of host addr use / as base url instead of host addr in serve cmd Feb 23, 2024
src/bin/cobalt/serve.rs Outdated Show resolved Hide resolved
@epage
Copy link
Member

epage commented Feb 26, 2024

As I don't deal with tunneling, I overlooked this. As this should still work for local development, I'm fine with this.

@epage epage merged commit ee62e2e into cobalt-org:master Feb 28, 2024
11 of 12 checks passed
@epage
Copy link
Member

epage commented Feb 28, 2024

Thanks!

@jcbhmr jcbhmr deleted the patch-1 branch February 28, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants