Adding simple if not to yield exception.

Open Beginner friendly
#337 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
75/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
lua
Domain
networking

Research direction

Start at lib/resty/http.lua around line 797 and inspect the header access described in the issue. Add the nil guard there, then verify that cases with no header no longer raise the unnecessary exception.

Written by the indexing model from the issue text.

Description

https://github.com/ledgetech/lua-resty-http/blob/183310324026120ab7eaf5dd82b9be90ae63aadf/lib/resty/http.lua#L797
There are many cases where the header may be nil and it's yielding with un-needed exception.
Should add a simple if before accessing the header.

Dominant language
Lua
Stars
2.1k
Forks
630
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ledgetech/lua-resty-http

All issues in ledgetech/lua-resty-http

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.