##// END OF EJS Templates
hgweb: encode WSGI environment using the ISO-8859-1 codec...
hgweb: encode WSGI environment using the ISO-8859-1 codec The WSGI specification (PEP 3333) specifies that on Python 3 all strings passed by the server must be of type str with code points encodable using the ISO 8859-1 codec. For some reason, I introduced a bug in 2632c1ed8f34 by applying the reverse change. Maybe I got confused because PEP 3333 says that arbitrary operating system environment variables may be contained in the WSGI environment and therefore we need to handle the WSGI environment variables like we would handle operating system environment variables. The bug mentioned in the previous paragraph and fixed by this changeset manifested e.g. in the path of the URL being encoded in the wrong way. Browsers encode non-ASCII bytes with the percent-encoding. WSGI servers will decode the percent-encoded bytes and pass them to the application as strings where each byte is mapped to the corresponding code point with the same ordinal (i.e. it is decoded using the ISO-8859-1 codec). Mercurial uses the bytes type for these strings (which makes much more sense), so we need to encode it again using the ISO-8859-1 codec. If we use another codec, it can result in nonsense.

File last commit:

r51576:d39ac346 default
r51713:9ed281bb stable
Show More
Cargo.toml
25 lines | 514 B | application/toml | TOMLLexer
Antoine Cezar
rhg: add rhg crate...
r45503 [package]
name = "rhg"
version = "0.1.0"
Raphaël Gomès
rhg: use `format_bytes!` for error messages...
r46598 authors = [
"Antoine Cezar <antoine.cezar@octobus.net>",
"Raphaël Gomès <raphael.gomes@octobus.net>",
]
Raphaël Gomès
rust: move all crates in the main workspace to edition 2021...
r50524 edition = "2021"
Antoine Cezar
rhg: add rhg crate...
r45503
[dependencies]
Raphaël Gomès
rhg: upgrade dependencies...
r49807 atty = "0.2.14"
Antoine Cezar
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`...
r45592 hg-core = { path = "../hg-core"}
Raphaël Gomès
rhg: upgrade the remainder of the dependencies...
r50535 chrono = "0.4.23"
Raphaël Gomès
rhg: upgrade `clap` dependency...
r50534 clap = { version = "4.0.24", features = ["cargo"] }
Raphaël Gomès
rhg: upgrade dependencies...
r49807 derive_more = "0.99.17"
Raphaël Gomès
rhg: upgrade the remainder of the dependencies...
r50535 home = "0.5.4"
Simon Sapin
rhg: Fall back to Python on --repository with an URL...
r47463 lazy_static = "1.4.0"
Raphaël Gomès
rhg: upgrade the remainder of the dependencies...
r50535 log = "0.4.17"
Raphaël Gomès
rust: use `logging_timer` instead of `micro_timer`...
r50808 logging_timer = "1.1.0"
Raphaël Gomès
rhg: upgrade the remainder of the dependencies...
r50535 regex = "1.7.0"
env_logger = "0.9.3"
Simon Sapin
rust: Upgrade to format-bytes 0.3...
r49323 format-bytes = "0.3.0"
Raphaël Gomès
rust-dependencies: switch from `users` to `whoami`...
r51576 whoami = "1.4"
Raphaël Gomès
rhg: upgrade the remainder of the dependencies...
r50535 which = "4.3.0"
Raphaël Gomès
rust: upgrade `rayon` dependency...
r51221 rayon = "1.7.0"