Settings

Theme

Writing a Language Server in Bash

prefab.cloud

1 points by tpetr 2 years ago · 1 comment

Reader

mdaniel 2 years ago

  # Capture the content-length header value
  [[ "$line" =~ ^Content-Length:\ ([0-9]+) ]]
Be forewarned that the space after any http header is optional <https://www.rfc-editor.org/rfc/rfc9112#name-field-syntax> so require it in your match at your peril. And, of course, http headers are case insenstiive so checking for the upper in any position is rolling the dice

  id=$(echo -E "$json_payload" | jq -r '.id')
that answers my question about how "in Bash" was going to deal with all the json

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection