Skip to content

v. 0.5.0 - #8

Merged
Res-NeoTech merged 1 commit into
masterfrom
fix/router-upgrade
Mar 26, 2026
Merged

Res-NeoTech merged 1 commit into
masterfrom
fix/router-upgrade

Conversation

@Res-NeoTech

Copy link
Copy Markdown
Owner

As a Ferrox maintainer, I am very pleased to announce the release of Ferrox v. 0.5.0 which introduces a lot of new features.

  • Correct URL decoding using urlencoding crate. This resolves URL Parsing Issue #7
  • SPA mode is now available and fully functional (any framework which handles routing on client-side is now compatible with Ferrox), classic website is also available, though requires to be specified in ferrox.yml file (see example on the repo).
  • Asynchrone and other performance enhancements in static_files module.

…while conserving the classis website serving. Enhanced performance in file serving by replacing standard blocking functions with tokio asynchrone ones.
@Res-NeoTech
Res-NeoTech merged commit 9873077 into master Mar 26, 2026
1 check passed
@Res-NeoTech
Res-NeoTech deleted the fix/router-upgrade branch March 26, 2026 14:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c65bca8fed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server.rs
Comment on lines +289 to +292
let res = Response::error("400", "Bad Request");

res.write_headers(&mut stream, &config).await?;
return Ok(());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Send the 400 body when URL decoding fails

In handle, the decode(&request.path) error branch writes headers and immediately returns, but never writes res.body. Response::error("400", "Bad Request") sets a non-zero Content-Length, so malformed paths (for example invalid percent-encoding) produce truncated responses that violate the advertised length and can confuse strict HTTP clients/proxies. This should mirror the existing parse-error path by sending the body bytes before returning.

Useful? React with 👍 / 👎.

Comment on lines +38 to +40
return Ok(Response::redirect(
"301 Moved Permanently",
&format!("{file_path}/"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-encode redirect targets built from decoded paths

serve_file now receives a decoded path, but the directory redirect still uses format!("{file_path}/") directly for the Location header. For requests like /My%20Docs (a valid encoded URI), this emits Location: /My Docs/, which is not a valid escaped URI and can be rejected or normalized inconsistently by clients. Build redirects from the original raw path or percent-encode the decoded path before setting Location.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encoding the redirect path actually breaks the logic. If we leave it as it is, the redirect functionality remains unaffected.

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.

URL Parsing Issue

1 participant