Skip to content

Resolved localhost false-positive HTTP method parsing and added corresponding unit tests.#1885

Closed
Hootsworth wants to merge 2 commits into
httpie:masterfrom
Hootsworth:master
Closed

Resolved localhost false-positive HTTP method parsing and added corresponding unit tests.#1885
Hootsworth wants to merge 2 commits into
httpie:masterfrom
Hootsworth:master

Conversation

@Hootsworth

Copy link
Copy Markdown

Pull Request Descriptions

This document contains ready-to-use pull request descriptions for both the Isar and HTTPie CLI repository PRs.


1. Isar Pull Request Description

Description

This PR implements the missing secondary index query iteration support in Isar's Rust-based native query engine (resolving the todo!() in IndexIterator), and resolves unstable compilation issues on the stable Rust release channel (which caused CI builds to fail).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issues

Fixes compiler E0554 errors on stable channel and implements secondary index Native iteration.

Changes Made

  • packages/isar_core/src/native/native_index.rs: Exposed the underlying index database (db) of NativeIndex via pub(crate).
  • packages/isar_core/src/native/query/mod.rs: Updated QueryIndex::Secondary enum variant to include the index index (u16) to select the correct secondary index database.
  • packages/isar_core/src/native/query/index_iterator.rs: Implemented the Secondary match block in next_iterator to retrieve database cursors, range iterate index keys, and look up matching object records using the primary collection cursor.
  • packages/isar_core_ffi/src/lib.rs: Removed the obsolete #![feature(vec_into_raw_parts)] unstable compiler gate. Since vec_into_raw_parts became stable in Rust 1.93.0, it is no longer required and was causing compilation errors on stable release channels (such as CI runner environments).

Testing

  • All existing cargo targets compile successfully
  • Added unit tests
  • Tested on multiple platforms (macOS, Linux)

2. HTTPie CLI Pull Request Description

Description

This PR fixes a bug in HTTPie CLI where purely alphabetic hostnames (such as localhost or httpbin) are incorrectly parsed as the HTTP method when request items are present.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Test improvements

Related Issues

Fixes localhost shorthand parsing false positive.

Changes Made

  • httpie/cli/argparser.py: Updated _guess_method logic to verify the parsed method against standard HTTP methods. If it's purely alphabetic but not in the list, we treat it as a host/URL.
  • tests/test_cli.py: Added the test_localhost_with_request_items_does_not_parse_as_method unit test.

Testing

  • All existing tests pass
  • Added tests for new functionality
  • Tested on multiple platforms (macOS)

Aditya Dixit and others added 2 commits June 30, 2026 14:50
fix(cli): prevent purely alphabetic hostnames like localhost from being parsed as HTTP method
@Hootsworth Hootsworth closed this Jun 30, 2026
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.

1 participant