luckyframework / luckyframework/lucky

Add remote_address assignment to Context

Open Beginner friendly
#2,052 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
2.7k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Starting in Crystal 1.22, `HTTP::Server::Context` will have a `remote_address` property

https://github.com/crystal-lang/crystal/commit/db94c7a7d71f5f1b1b695a4a3a7e22e25af98ac0

Lucky currently patches `HTTP::Request` for this

https://github.com/luckyframework/lucky/blob/692e5b7ef5621638339dcc0b75b697a2283c0cb7/src/charms/request_extensions.cr#L8

https://github.com/luckyframework/lucky/blob/692e5b7ef5621638339dcc0b75b697a2283c0cb7/src/lucky/remote_ip_handler.cr#L32

We should add this in and gate to 1.22 so we can eventually just get rid of the request patch

Contributor guide

Open the contributing guide

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.

Research direction

Start with src/charms/request_extensions.cr and src/lucky/remote_ip_handler.cr, then compare the Crystal 1.22 change linked in the issue. Add the remote_address assignment to HTTP::Server::Context behind the 1.22 compatibility gate, while preserving current behavior for older versions. Done means the context receives the remote address without relying solely on the request patch.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.