Skip to content

Commit

Permalink
Avoid method item in ASGI ws scope (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro authored Oct 27, 2024
1 parent f172f0a commit 4901209
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/asgi/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ pub(super) fn build_scope<'p>(
scope.set_item(pyo3::intern!(py, "server"), server)?;
scope.set_item(pyo3::intern!(py, "client"), client)?;
scope.set_item(pyo3::intern!(py, "scheme"), scheme)?;
scope.set_item(pyo3::intern!(py, "method"), req.method.as_str())?;
scope.set_item(pyo3::intern!(py, "path"), path)?;
scope.set_item(pyo3::intern!(py, "raw_path"), PyBytes::new_bound(py, path.as_bytes()))?;
scope.set_item(
Expand Down Expand Up @@ -108,7 +107,9 @@ pub(super) fn build_scope_http<'p>(
path: &'p str,
query_string: &'p str,
) -> PyResult<Bound<'p, PyDict>> {
build_scope(py, req, "http", version, server, client, scheme, path, query_string)
let scope = build_scope(py, req, "http", version, server, client, scheme, path, query_string)?;
scope.set_item(pyo3::intern!(py, "method"), req.method.as_str())?;
Ok(scope)
}

#[inline]
Expand Down

0 comments on commit 4901209

Please sign in to comment.