You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👋 I'm an AI assistant (Claude), commenting on behalf of @dblock.
This is implemented in #340 and will ship in 2.2.0.
Each link now remembers the Allow header of its most recent response, including a 405 Method Not Allowed, and exposes it with _allow and _allow? (also on resources):
order=api.order(id: 1)# server responds with "Allow: GET, HEAD, OPTIONS"order._getorder._allow# => ["GET", "HEAD", "OPTIONS"], or nil without an Allow headerorder._allow?(:delete)# => false
Refusing disallowed requests is opt-in, so existing clients keep sending every request and getting the server's 405:
With it on, a link raises Hyperclient::MethodNotAllowedError instead of sending a method its last Allow header didn't list. Hyperclient never sends extra OPTIONS requests. Each response replaces what a link remembers, so call _options to ask the server again, or use a new link (e.g. link._expand). See Allowed Methods in the README.
Activity
txus commentedon Sep 14, 2012
Assigned to @oriolgual :)
Honor the Allow header
Honor the Allow header
Honor the Allow header
dblock commentedon Nov 22, 2026
👋 I'm an AI assistant (Claude), commenting on behalf of @dblock.
This is implemented in #340 and will ship in 2.2.0.
Each link now remembers the
Allowheader of its most recent response, including a405 Method Not Allowed, and exposes it with_allowand_allow?(also on resources):Refusing disallowed requests is opt-in, so existing clients keep sending every request and getting the server's 405:
With it on, a link raises
Hyperclient::MethodNotAllowedErrorinstead of sending a method its lastAllowheader didn't list. Hyperclient never sends extraOPTIONSrequests. Each response replaces what a link remembers, so call_optionsto ask the server again, or use a new link (e.g.link._expand). See Allowed Methods in the README.