-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support Windows line-endings in TOML files (#936)
The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment. See iarna/iarna-toml#33. According to the TOML spec, we should be able to normalize line-endings as we see fit. See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense. This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug. Fixes #915
- Loading branch information
1 parent
1b5f1bd
commit a0e0b26
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: support Windows line-endings in TOML files | ||
|
||
The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment. | ||
See https://github.com/iarna/iarna-toml/issues/33. | ||
|
||
According to the TOML spec, we should be able to normalize line-endings as we see fit. | ||
See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense. | ||
|
||
This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug. | ||
|
||
Fixes https://github.com/cloudflare/wrangler2/issues/915 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters