Skip to content

Issue with Passing Multiple Command Line Arguments to WAGI Handler via URL #192

Open
@FerrazArthur

Description

@FerrazArthur

I'm currently working with the WAGI interface and I'm facing an issue when trying to pass multiple arguments to a C to WebAssembly (WASM) handler. The handler code uses argv to iterate through arguments. While I've been successful in passing individual arguments like '--tamanho=10000' or '--help' with QUERY_STRING, I'm struggling to pass multiple arguments.

Valid Arguments:

--tamanho=<integer>: Specifies the number of elements to be sorted.
--imprime: Enables the printing of elements before and after sorting.
--help: Prints the help information.

Problem:
I need to pass multiple arguments simultaneously, such as --tamanho=20 and --imprime, but I haven't been able to do this successfully.

Attempts:
I've tried various ways to pass these multiple arguments, but none of them have worked:

curl http://127.0.0.1:3000/quicksort?--tamanho=20+--imprime
curl http://127.0.0.1:3000/quicksort?--tamanho=20\+--imprime
curl http://127.0.0.1:3000/quicksort?"--tamanho=20\+--imprime"
curl "http://127.0.0.1:3000/quicksort?--tamanho=20\+--imprime"
curl http://127.0.0.1:3000/quicksort?param1=--tamanho=20&param2=--imprime
curl http://127.0.0.1:3000/quicksort?param1=--tamanho=20\&param2=--imprime
curl http://127.0.0.1:3000/quicksort?--tamanho=1000%20--imprime
curl http://127.0.0.1:3000/quicksort?--tamanho=1000\%20--imprime
curl http://127.0.0.1:3000/quicksort?--tamanho=1000\ --imprime

Expected Behavior:
I should be able to pass multiple arguments, such as --tamanho=20 and --imprime, to the handler via the URL, and the handler should be able to correctly interpret and process these arguments.

Actual Behavior:
None of the above methods have successfully allowed me to pass multiple arguments to the WAGI handler in such a way that the argv[] identify them individually. Please advise on the correct way to pass multiple arguments in this scenario or provide a solution to this issue. In order to bypass this, i changed the design of the arguments string, but thats not ideal for my use case.

Thank you for your assistance in resolving this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions