Skip to content

Commit

Permalink
Item12180: Downgrade to uncachable RESOURCEURI when running under IIS…
Browse files Browse the repository at this point in the history
…. Exactly why this is required isn't fully understood, so this (hopefully) will change.

git-svn-id: http://svn.foswiki.org/trunk@16446 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Jan 23, 2013
1 parent f87e2d1 commit d52d790
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 28 deletions.
19 changes: 13 additions & 6 deletions core/lib/Foswiki/Configure/Dispatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ $pathinfo = $query->path_info();
}
$action =~ tr/A-Za-z0-9_-//cd;

my $usePinfo = 01; # Check for OS/browser issues before turning on?
# Use path style URIs except where the webserver can't deal with them.
# So far, Microsoft IIS is reportedly unable to cope...

my $usePinfo = ( $ENV{SERVER_SOFTWARE} || '' ) !~ /\b(Microsoft-IIS)\b/;

# generate references to resources
$resourceURI = $scriptName
Expand Down Expand Up @@ -711,14 +714,18 @@ sub _actionresource {
# ensure that updated data is provided. In particular, this
# allows .css files to contain URIs (e.g. for background images.)
# and still be cached. Don't add anything dynamic.
# N.B. Since some webservers may want to direct-map resources,
# we'll replace the hard-coded query string with $resourceURI
# in the sane ones.

( $text, my $etag, my $zipped ) = $parser->getResource(
$resource,
-remote => 1,
-etag => 1,
-binmode => !$text,
-zipok => $zipok,
RESOURCEURI => $resourceURI
-remote => 1,
-etag => 1,
-binmode => !$text,
-zipok => $zipok,
RESOURCEURI => $resourceURI,
'?action=resource&resource=' => $resourceURI,
);

defined $etag or htmlResponse( "$resource not found", 404 );
Expand Down
9 changes: 8 additions & 1 deletion core/lib/Foswiki/Configure/TemplateParser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,19 @@ sub getFile {
# Static content can use a weak validator.
# N.B. Vars are only handled at the top level in
# one pass over the interpolated text.
# the '?' hack is to fix URIs in styles.css - if it
# is direct-mapped, it doesn't pass thru here.

unless ( $binmode || $zipped ) {
$dynamic += $text =~
s/%INCLUDE{(.*?)}%/$this->getResource($1, -binmode => $binmode)/ges;
while ( my ( $k, $v ) = each %vars ) {
$dynamic += ( $text =~ s/\%$k\%/$v/gs );
if ( $k =~ /^\?/ ) {
$dynamic += ( $text =~ s/\Q$k\E/$v/gs );
}
else {
$dynamic += ( $text =~ s/\%$k\%/$v/gs );
}
}
}
}
Expand Down
51 changes: 30 additions & 21 deletions core/lib/Foswiki/Configure/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ body.configureShowOneSection .configureNotShowSection {
background-repeat:no-repeat;
}
.configureStatusOK {
background-image:url(%RESOURCEURI%icon_ok.png);
background-image:url(?action=resource&resource=icon_ok.png);
}
.configureStatusWarnings {
background-image:url(%RESOURCEURI%icon_warn.png);
background-image:url(?action=resource&resource=icon_warn.png);
}
.configureStatusErrors {
background-image:url(%RESOURCEURI%icon_error.png);
background-image:url(?action=resource&resource=icon_error.png);
}

.configureUndefinedValue {
Expand Down Expand Up @@ -241,7 +241,7 @@ table.configureFeedbackArray td {
}

div.configureFeedbackPending {
background-image:url(%RESOURCEURI%processing-bg.gif);
background-image:url(?action=resource&resource=processing-bg.gif);
min-height: 16px;
background-repeat:no-repeat;
background-position:left;
Expand Down Expand Up @@ -471,17 +471,17 @@ ul li a.configureWarn:hover {
ul li a.configureWarnAndError:link,
ul li a.configureWarnAndError:visited,
ul li a.configureWarnAndError:hover {
background-image:url(%RESOURCEURI%icon_warn_and_error.png);
background-image:url(?action=resource&resource=icon_warn_and_error.png);
}
ul li a.configureError:link,
ul li a.configureError:visited,
ul li a.configureError:hover {
background-image:url(%RESOURCEURI%icon_error.png);
background-image:url(?action=resource&resource=icon_error.png);
}
ul li a.configureWarn:link,
ul li a.configureWarn:visited,
ul li a.configureWarn:hover {
background-image:url(%RESOURCEURI%icon_warn.png);
background-image:url(?action=resource&resource=icon_warn.png);
}
ul li.configureMenuSelected a.configureWarnAndError:link,
ul li.configureMenuSelected a.configureWarnAndError:visited,
Expand All @@ -494,15 +494,15 @@ ul li.configureMenuSelected a.configureWarn:visited {
}
ul li.configureMenuSelected a.configureWarnAndError:link,
ul li.configureMenuSelected a.configureWarnAndError:visited {
background-image:url(%RESOURCEURI%icon_warn_and_error.png);
background-image:url(?action=resource&resource=icon_warn_and_error.png);
}
ul li.configureMenuSelected a.configureError:link,
ul li.configureMenuSelected a.configureError:visited {
background-image:url(%RESOURCEURI%icon_error.png);
background-image:url(?action=resource&resource=icon_error.png);
}
ul li.configureMenuSelected a.configureWarn:link,
ul li.configureMenuSelected a.configureWarn:visited {
background-image:url(%RESOURCEURI%icon_warn.png);
background-image:url(?action=resource&resource=icon_warn.png);
}
/* --- TABLE ROWS & COLUMNS --- */
/*
Expand Down Expand Up @@ -584,23 +584,23 @@ div.configureOk {
background-repeat:no-repeat;
}
div.configureError {
background-image:url(%RESOURCEURI%icon_error.png);
background-image:url(?action=resource&resource=icon_error.png);
}
div.configureWarn {
background-image:url(%RESOURCEURI%icon_warn.png);
background-image:url(?action=resource&resource=icon_warn.png);
}
div.configureDebug {
background-image:url(%RESOURCEURI%icon_debug.png);
background-image:url(?action=resource&resource=icon_debug.png);
}
div.configureUnsaved {
background-image:url(%RESOURCEURI%icon_changes.png);
background-image:url(?action=resource&resource=icon_changes.png);
}
div.configureNoChanges {
background-image:url(%RESOURCEURI%icon_nochanges.png);
background-image:url(?action=resource&resource=icon_nochanges.png);
}

div.configureOk {
background-image:url(%RESOURCEURI%icon_ok.png);
background-image:url(?action=resource&resource=icon_ok.png);
}

div.configureWarn ul,
Expand Down Expand Up @@ -731,7 +731,7 @@ table.configureExtensionsTable tr.configurePseudoInstalled td.action {
padding:0 .5em 7px 27px;
background-position:0 0;
background-repeat:no-repeat;
background-image:url(%RESOURCEURI%icon_world.png);
background-image:url(?action=resource&resource=icon_world.png);
}
.configureExtensionsInstallControls {
background: #EDF5FC;
Expand Down Expand Up @@ -768,13 +768,13 @@ table.configureExtensionsTable tr.configurePseudoInstalled td.action {

/* Settings and other stuff only shown in expert mode */
table.configureSectionValues tr.configureExpert th {
background-image:url(%RESOURCEURI%bg_expert.gif);
background-image:url(?action=resource&resource=bg_expert.gif);
background-repeat: repeat-y;
color:#7a6210;
}

.configureExpert { /* menu item */
background-image:url(%RESOURCEURI%bg_expert.gif);
background-image:url(?action=resource&resource=bg_expert.gif);
background-repeat: repeat-y;
color:#7a6210;
}
Expand Down Expand Up @@ -859,15 +859,15 @@ a.configureExpert:hover,
a.configureInfoText:link,
a.configureInfoText:visited,
a.configureInfoText:hover {
background-image:url(%RESOURCEURI%icon_up.gif);
background-image:url(?action=resource&resource=icon_up.gif);
}
a.configureNotExpert:link,
a.configureNotExpert:visited,
a.configureNotExpert:hover,
a.configureNotInfoText:link,
a.configureNotInfoText:visited,
a.configureNotInfoText:hover {
background-image:url(%RESOURCEURI%icon_down.gif);
background-image:url(?action=resource&resource=icon_down.gif);
}
.configureRootSection h2 {
margin-top:0.25em;
Expand Down Expand Up @@ -1038,6 +1038,15 @@ tr.configureStdLog pre {
padding: 0px;
margin: 0px;
}
tr.configureStdLog table.configureLogDetail {
border: 0px none;
margin-top: 0px;
margin-bottom: 0px;
}
table.configureLogDetail td {
border: 0px none;
padding-top: 0;
}

/* Responsive: Tablet to desktop */

Expand Down

0 comments on commit d52d790

Please sign in to comment.