ot : safari post problem

G

gerry

Hi, although this is not strictly asp.net related, I was hoping that someone
could confirm or debunk what appears to be a major problem with safari
POSTs.

with the following html :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML>
<HEAD>
<base id="BaseTag" href="http://www.mysite.net/"></base>
</HEAD>
<body>
<form name="TheForm" method="post" id="TheForm">
<input type="submit" name="SubmitBtn" value="Submit"
id="SubmitBtn" class="btn" />
</form>
</body>
</html>

note that there is a base tag and no action for the form tag.
regradless of the page/url that this is located at :
http://www.mysite.net/page1.htm
http://www.mysite.net/section1/page1.htm
http://www.mysite.net/section1/page1.htm?x1=x1&x2=2

in safari the post is always to the site root : http://www.mysite.net
in all other browsers ( so far ) the post is to the current url

To work around this I have had to include the following code in the
Application_BeginRequest Method in Global.asax :

if ( Request.Method=="POST" && Request.Path="/Default.htm" )
Response.Redirect(Request.Headers["Referer"]);

this works since POST is not valid for the default root document, in this
case Default.htm

My guess is that safari is incorrectly applying the BASE tag contents to the
missing FORM action rather than just using the current url.

I haven't found any reference to this is bugzilla - has anyone encountered
this issue ?

Thanks
Gerry
 
G

gerry

I was a little hasty with this post - the fix I included does in fact not
work, the redirect to the correct url simply causes another post to the root
document.
For now I have advised the client to install the latest version of mozilla
and forget safari altogether

I do have some debug logging the the Application_BeginRequest method ,
for both the initial & redirected POSTs the following values are set :
- Request.Headers["Referer"] = http://www.mysite.net/Section1/Page1.htm
- Request.Path=/Default.htm

Gerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top