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

Add query string parsing in get_file #29

Merged

Conversation

lab360-ch
Copy link

@lab360-ch lab360-ch commented May 6, 2022

Lately, Figma tries to load the local fonts with an additional query parameter freetype_minimum_api_version.

Here is an example of the request URL: http://127.0.0.1:18412/figma/font-file?file=<font_path>&freetype_minimum_api_version=20

In the current implementation, the request URL /figma/font-file?file=<font_path>&freetype_minimum_api_version=20 only gets spliced and not properly parsed.

src/routes/get_file.rs:19

let file_path = string[22..string.len()].to_string();

Result of file_path for the given request URL is <font_path>&freetype_minimum_api_version=20 and should be <font_path>.

The changes in this pull request will parse the request URL and create an HashMap with all query parameters.

@ChugunovRoman ChugunovRoman merged commit 49efd1a into Figma-Linux:master May 7, 2022
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.

3 participants