fix: Correct HttpRequestBox method_id mapping in nyash.toml

Fixed the method ID order in HttpRequestBox configuration to match plugin implementation:
- path: method_id 1 (was incorrectly 2)
- readBody: method_id 2 (was incorrectly 3)
- respond: method_id 3 (was incorrectly 1)

This resolves the 45-day debugging issue where req.respond(resp) was calling
the wrong plugin method, causing HTTP responses to have empty bodies.

All E2E tests now pass:
- e2e_http_stub_end_to_end 
- e2e_http_multiple_requests_order 
- e2e_http_post_and_headers 
- e2e_http_server_restart 
- e2e_http_server_shutdown_and_restart 

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-22 12:09:06 +09:00
parent 0915815340
commit 080458d4d4
24 changed files with 694 additions and 255 deletions

View File

@ -8,7 +8,8 @@
*/
use super::super::*;
use crate::box_trait::{ResultBox, StringBox, NyashBox};
use crate::boxes::ResultBox;
use crate::box_trait::{StringBox, NyashBox};
use crate::boxes::FileBox;
// use crate::bid::plugin_box::PluginFileBox; // legacy - FileBox専用
@ -77,7 +78,7 @@ impl NyashInterpreter {
pub(in crate::interpreter) fn execute_result_method(&mut self, result_box: &ResultBox, method: &str, arguments: &[ASTNode])
-> Result<Box<dyn NyashBox>, RuntimeError> {
match method {
"isOk" => {
"isOk" | "is_ok" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation {
message: format!("isOk() expects 0 arguments, got {}", arguments.len()),
@ -85,7 +86,7 @@ impl NyashInterpreter {
}
Ok(result_box.is_ok())
}
"getValue" => {
"getValue" | "get_value" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation {
message: format!("getValue() expects 0 arguments, got {}", arguments.len()),
@ -93,7 +94,7 @@ impl NyashInterpreter {
}
Ok(result_box.get_value())
}
"getError" => {
"getError" | "get_error" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation {
message: format!("getError() expects 0 arguments, got {}", arguments.len()),
@ -343,4 +344,4 @@ impl NyashInterpreter {
self.execute_plugin_method_generic(plugin_file_box, method, arguments)
}
*/
}
}