0
아래 코드 감안할 때
... Net :: HTTP :: Unauthorized - WWW-Authenticate 헤더를 얻으려면 어떻게해야합니까?
Net::HTTP.start('localhost', 4000) do |http|
#
# usual stuff omitted for clarity
#
@response = http.request(req)
end
... A (바르게 행동) 서버는 401 (Unauthorized) 응답을 반환하는 경우, 어떻게이 WWW_Authenticate 헤더에서받을 수 있나요? 내가있어 가장 좋은 해결책은 전혀 좋지 않다
...
class Net::HTTPUnauthorized
def get_header(h)
_return = nil
target = h.upcase
self.header.each_header do |k, v|
if k.upcase == target
_return = v
break
end
end
_return
end
end
크리스