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

URL not escaped correctly for icon #661

Closed
BarryNolte opened this issue Jan 13, 2023 · 0 comments · Fixed by #666
Closed

URL not escaped correctly for icon #661

BarryNolte opened this issue Jan 13, 2023 · 0 comments · Fixed by #666
Labels
bug Something isn't working compiler

Comments

@BarryNolte
Copy link
Contributor

Linux version 5.15.0-57-generic (buildd@lcy02-amd64-110) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #63-Ubuntu SMP Thu Nov 24 13:43:17 UTC 2022

D2 v0.1.5

Run D2 on file containing the following:

gateway: "" {
icon: https://icons.terrastruct.com/aws/Networking%20&%20Content%20Delivery/Amazon-API-Gateway_Endpoint_light-bg.svg
shape: image
height: 100
width: 100
}


produces the error:

err: failed to bundle https://icons.terrastruct.com/aws/Networking%20&%20Content%20Delivery/Amazon-API-Gateway_Endpoint_light-bg.svg: expected status 200 but got 403 403 Forbidden
err: failed to fully compile (partial render written): failed to bundle remote images: [https://icons.terrastruct.com/aws/Networking%20&%20Content%20Delivery/Amazon-API-Gateway_Endpoint_light-bg.svg]

Neither D2 or FireFox can resolve that URL.

This comes down to the ampersand being escaped to & instead of %26. It appears that HTML encoding is being used instead of URI encoding.

@cyborg-ts cyborg-ts added this to D2 Jan 13, 2023
@alixander alixander added bug Something isn't working compiler labels Jan 13, 2023
@github-project-automation github-project-automation bot moved this to Done in D2 Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants