Skip to content

[Net\serve] post method causes SIGSEGV error on Windows and Linux #2046

@scifx

Description

@scifx

Describe the bug

serve .port:18966 [
    
    GET "/"                     [ "This is the homepage" ]
    GET "/post"                 $[id][ 
                                    send.html ~"This is the post with id: |id|" 
                                ]                
    POST "/getinfo"             $[id][ 
                                    send.json write.json ø #[
                                        i: id
                                        msg: "This is some info"
                                    ] 
                                ]
]

; run the app and go to localhost:18966 - that was it!
; the app will respond to GET requests to "/" or "/post?id=..."
; and also POST requests to "/getinfo" with an 'id' parameter

The Net\serve method's post feature does not work as expected. When invoked, it raises a segmentation fault with the message: SIGSEGV: Illegal storage access. (Attempt to read from nil?)

To Reproduce

  1. Prepare a function using Net\serve with the post method as demonstrated in the official documentation.
  2. Run the function on platforms between versions 0.983 to 0.984.
  3. Platform: Windows and Linux.
  4. Post request request.post "http://localhost:18966/getinfo" #[ id:5 ]
  5. Observe the crash and the error message.
    Expected behavior
    The post method should execute normally and not crash.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows, Linux
  • Version: 0.983~0.984

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions