0
Vu le code ci-dessous ...Net :: HTTP :: Unauthorized - Comment obtenir l'en-tête WWW-Authenticate?
Net::HTTP.start('localhost', 4000) do |http|
#
# usual stuff omitted for clarity
#
@response = http.request(req)
end
... si un serveur (bien élevé) renvoie une réponse 401 (non autorisée), comment puis-je l'en-tête de WWW_Authenticate?
La meilleure solution que j'ai est pas du tout bon ...
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
Chris