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

A + in a URL is sometimes decoded as a space #1055

Closed
Fil opened this issue Mar 14, 2024 · 6 comments
Closed

A + in a URL is sometimes decoded as a space #1055

Fil opened this issue Mar 14, 2024 · 6 comments
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Mar 14, 2024

This affects at least one user who reported that their site hosted on S3 was broken. dist/_npm/d3@7.9.0/+esm.js was 403, but dist/_npm/d3@7.9.0/%2Besm.js was 200.

We could (must) url-encode the src. But, it's going to look ugly… maybe we can find a better way. (Also we should make sure that we url-encode everything that needs to be encoded.)

@Fil Fil added the bug Something isn’t working label Mar 14, 2024
@mbostock
Copy link
Member

mbostock commented Mar 14, 2024

Maybe a simple thing we could do here is -esm.js or _esm.js instead of +esm.js? The purpose of + is to avoid a conflict with some other file in that package, but I don’t think in practice that we’d ever see a -esm.js or _esm.js either. .esm.js could also work (but maybe is undesirable since it would hide the file).

Another possibility is dist/_npm/d3@7.9.0.js but I think this would be harder to implement since we currently use the directory dist/_npm/d3@7.9.0 to check for already-resolved versions.

@Fil
Copy link
Contributor Author

Fil commented Mar 14, 2024

I'll try that. It will also clarify the code (+esm will be the source, and -esm will be our copy).

@mbostock mbostock self-assigned this Mar 14, 2024
@mbostock
Copy link
Member

Oops, sorry I already started… 😬

@mbostock
Copy link
Member

mbostock commented Mar 14, 2024

We should probably still URL-encode such links as needed… that’s a bug and _esm.js is just a workaround?

@mbostock mbostock mentioned this issue Mar 14, 2024
@mbostock mbostock removed their assignment Mar 14, 2024
@Fil
Copy link
Contributor Author

Fil commented Mar 14, 2024

Yes we must urlencode the link and it's nicer to use an underscore (#1056) because the urlencoded + is "ugly".

@Fil
Copy link
Contributor Author

Fil commented Mar 15, 2024

not planning to urlencode everything for now—it's too messy

@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants