Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 582134 Details for
Bug 804661
rubygem-thin server does not respond correctly with 401, missing WWW-Authenticate header
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for Katello to set WWW-Authentication header in case no credentials provided
0001-804661-set-WWW-Authenticate-header-if-no-credentials.patch (text/plain), 1.49 KB, created by
Ivan Necas
on 2012-05-04 14:48:31 UTC
(
hide
)
Description:
Patch for Katello to set WWW-Authentication header in case no credentials provided
Filename:
MIME Type:
Creator:
Ivan Necas
Created:
2012-05-04 14:48:31 UTC
Size:
1.49 KB
patch
obsolete
>From acdeebbc788539e831d7a274e11d22110175c918 Mon Sep 17 00:00:00 2001 >From: Ivan Necas <inecas@redhat.com> >Date: Fri, 4 May 2012 16:38:19 +0200 >Subject: [PATCH] 804661 - set WWW-Authenticate header if no credentials > provided > >Let Warden to send custom response in case no credentials provided so that it's >compliant against HTTP specification. >--- > src/config/initializers/warden.rb | 16 +++++++++++++++- > 1 files changed, 15 insertions(+), 1 deletions(-) > >diff --git a/src/config/initializers/warden.rb b/src/config/initializers/warden.rb >index 6924f7c..d8a70d9 100644 >--- a/src/config/initializers/warden.rb >+++ b/src/config/initializers/warden.rb >@@ -17,7 +17,7 @@ Rails.configuration.middleware.use RailsWarden::Manager do |config| > # API requests are handled in the :api scope > config.scope_defaults( > :api, >- :strategies => [:oauth, :sso, :certificate, AppConfig.warden.to_sym], >+ :strategies => [:oauth, :sso, :certificate, AppConfig.warden.to_sym, :no_credentials], > :store => false, > :action => 'unauthenticated_api' > ) >@@ -168,3 +168,17 @@ Warden::Strategies.add(:oauth) do > end > end > >+Warden::Strategies.add(:no_credentials) do >+ >+ # the fact we got here means we no credentials were provided and we can make >+ # steps to update HTTP headers to indicate that we require credentials >+ def valid? >+ true >+ end >+ >+ def authenticate! >+ custom! [401, {"WWW-Authenticate" => 'Basic realm="Secure Area"'}, "No credentails provided"] >+ end >+end >+ >+ >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 804661
: 582134