Last Comment Bug 364008 - IIS5 gives 405 error on login from homepage (index.cgi not explicitly specified)
: IIS5 gives 405 error on login from homepage (index.cgi not explicitly specified)
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: User Interface (show other bugs)
: 2.22.1
: x86 Windows XP
: -- minor with 2 votes (vote)
: Bugzilla 3.0
Assigned To: Michael Kincaid
: default-qa
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-15 15:26 PST by Michael Kincaid
Modified: 2007-05-21 11:20 PDT (History)
4 users (show)
justdave: approval+
justdave: approval3.0+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch to login-small.html.tmpl to explicity supply index.cgi as part of the POST url (525 bytes, patch)
2006-12-15 15:28 PST, Michael Kincaid
justdave: review+
Details | Diff | Splinter Review
Patch to login.html.tmpl to explicitly supply index.cgi as part of the POST url (470 bytes, patch)
2007-05-17 15:50 PDT, Michael Kincaid
justdave: review+
Details | Diff | Splinter Review
combined patch (same as above two) (1.39 KB, patch)
2007-05-21 11:16 PDT, Dave Miller [:justdave] (justdave@bugzilla.org)
justdave: review+
Details | Diff | Splinter Review

Description Michael Kincaid 2006-12-15 15:26:15 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: 2.22.1

IIS5 does not accept POST (or for that matter any verb but GET or HEAD) without an explicit filename, because it isn't smart enough to figure out that a POST to
http://my.server.name/ should use the same handler as a POST to
http://my.server.name/index.cgi. Instead it returns a 405 error. MS says they've fixed it in IIS6:
http://support.microsoft.com/kb/216493

Reproducible: Always

Steps to Reproduce:
1. Running Bugzilla on IIS5/Win32, go to Bugzilla home page when not logged in
2. Attempt to log in on the home page.
Actual Results:  
IIS returns 405 error. User is not logged in. Login from other pages is possible.

Expected Results:  
Logged in home page would appear.

I've attached a patch to login-small.default.tmpl to work around this problem by always supplying index.cgi as the current path where not otherwise specified.
Comment 1 Michael Kincaid 2006-12-15 15:28:25 PST
Created attachment 248787 [details] [diff] [review]
Patch to login-small.html.tmpl to explicity supply index.cgi as part of the POST url
Comment 2 Graeme Harker 2007-04-10 23:24:27 PDT
*** This bug has been confirmed by popular vote. ***
Comment 3 Graeme Harker 2007-04-10 23:28:48 PDT
I can confirm that this bug is still a problem in Bugzilla 3.0rc1 on IIS 5.1 and that Michael Kincaid's fix still works in Bugzilla 3.0rc1 
Comment 4 Michael Kincaid 2007-05-17 15:50:53 PDT
Created attachment 265166 [details] [diff] [review]
Patch to login.html.tmpl to explicitly supply index.cgi as part of the POST url

This also affects the "Log in" link from the homepage, which uses login.html.tmpl rather than login-small.html.tmpl, so I've attached a patch for login.html.tmpl as well.
Comment 5 Max Kanat-Alexander 2007-05-17 15:54:14 PDT
Wow, that's SO STUPID (of IIS5). Like, that's terminally dumb.

I don't really want to put this fix into the main Bugzilla itself, but we can certainly have it here for people who need it. I just don't like using index.cgi manually when we don't have to.
Comment 6 Frédéric Buclin 2007-05-18 02:36:31 PDT
Weird. Using Apache, the filename on my installation (both 3.0 and 3.1) is http://.../bugzilla/index.cgi, not http://.../bugzilla/ alone. Why isn't CGI returning the 'index.cgi' part when used with IIS5? IMO, it shouldn't be related to your web server.
Comment 7 Byron Jones ‹:glob› [PTO until 2017-01-09] 2007-05-18 03:39:56 PDT
the cgi only knows what it can see in %ENV, which is set up by the web server.
Comment 8 Jacob Steenhagen 2007-05-18 06:51:06 PDT
Being that this only specifies index.cgi to be the target if the target is undefined, IMHO it should go in.
Comment 9 Frédéric Buclin 2007-05-19 12:05:12 PDT
(In reply to comment #8)
> Being that this only specifies index.cgi to be the target if the target is
> undefined, IMHO it should go in.

Yeah, this probably doesn't hurt.
Comment 10 Frédéric Buclin 2007-05-19 18:25:36 PDT
Before requesting approval, you need your patch to be reviewed. Set the review flag to '?' first and wait for a reviewer to grant review.
Comment 11 Dave Miller [:justdave] (justdave@bugzilla.org) 2007-05-19 18:37:24 PDT
Comment on attachment 248787 [details] [diff] [review]
Patch to login-small.html.tmpl to explicity supply index.cgi as part of the POST url

duplicate attachment
Comment 12 Dave Miller [:justdave] (justdave@bugzilla.org) 2007-05-19 18:38:19 PDT
Comment on attachment 248787 [details] [diff] [review]
Patch to login-small.html.tmpl to explicity supply index.cgi as part of the POST url

er, nevermind that, this is the same patch to two different templates :)  oops.  Was going to grant review anyway, this is pretty obvious.
Comment 13 Dave Miller [:justdave] (justdave@bugzilla.org) 2007-05-21 11:16:12 PDT
Created attachment 265531 [details] [diff] [review]
combined patch (same as above two)

This is the same as the above patches, with the windows formatting changed to unix and using unified diff format to make it easy to apply.

Applies cleanly on both branches.
Comment 14 Dave Miller [:justdave] (justdave@bugzilla.org) 2007-05-21 11:20:16 PDT
Trunk:

Checking in template/en/default/account/auth/login-small.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/auth/login-small.html.tmpl,v  <--  login-small.html.tmpl
new revision: 1.9; previous revision: 1.8
done
Checking in template/en/default/account/auth/login.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/auth/login.html.tmpl,v  <--  login.html.tmpl
new revision: 1.19; previous revision: 1.18
done

3.0 branch:

Checking in template/en/default/account/auth/login-small.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/auth/login-small.html.tmpl,v  <--  login-small.html.tmpl
new revision: 1.8.2.1; previous revision: 1.8
done
Checking in template/en/default/account/auth/login.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/auth/login.html.tmpl,v  <--  login.html.tmpl
new revision: 1.18.2.1; previous revision: 1.18
done

Note You need to log in before you can comment on or make changes to this bug.