Skip to content

Commit

Permalink
Item11187: Fix status codes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/OpenLayersPlugin@13271 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Dec 2, 2011
1 parent 5aaa570 commit 0fb51c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions data/System/OpenLayersPlugin.txt
Expand Up @@ -44,7 +44,7 @@ Example
viewport1="Applications/OpenLayers/Layers/ALA_GreatBarrierReef"
viewportzoom="-1"
mapprojection="EPSG:4326"
layertopics="Applications/OpenLayers/Layers/DefaultMap,Applications/OpenLayers/Layers/Demis_Layer,Applications/OpenLayers/Layers/ALA_GreatBarrierReef,Applications/OpenLayers/Layers/TRIN_Specimens,Applications/OpenLayers/Layers/MyKMLFeatures,Applications/OpenLayers/Layers/MarineEcoRegions"
layertopics="Applications/OpenLayers/Layers/DefaultMap,Applications/OpenLayers/Layers/Demis_Layer,Applications/OpenLayers/Layers/ALA_GreatBarrierReef,Applications/OpenLayers/Layers/TRIN_Specimens,Applications/OpenLayers/Layers/MyKMLFeatures,Applications/OpenLayers/Layers.ALA_GreatBarrierReef"
mapelement="myMap"
styleobject=""
basetopics=""
Expand All @@ -57,7 +57,7 @@ Preview
viewport1="Applications/OpenLayers/Layers/ALA_GreatBarrierReef"
viewportzoom="-1"
mapprojection="EPSG:4326"
layertopics="Applications/OpenLayers/Layers/DefaultMap,Applications/OpenLayers/Layers/Demis_Layer,Applications/OpenLayers/Layers/ALA_GreatBarrierReef,Applications/OpenLayers/Layers/TRIN_Specimens,Applications/OpenLayers/Layers/MyKMLFeatures,Applications/OpenLayers/Layers/MarineEcoRegions"
layertopics="Applications/OpenLayers/Layers/DefaultMap,Applications/OpenLayers/Layers/Demis_Layer,Applications/OpenLayers/Layers/ALA_GreatBarrierReef,Applications/OpenLayers/Layers/TRIN_Specimens,Applications/OpenLayers/Layers/MyKMLFeatures,Applications/OpenLayers/Layers.ALA_GreatBarrierReef"
mapelement1="myMap"
styleobject=""
basetopics=""
Expand Down
9 changes: 5 additions & 4 deletions lib/Foswiki/Plugins/OpenLayersPlugin.pm
Expand Up @@ -143,23 +143,24 @@ sub _getJSON {
);
}
else {
$output = "$url did not return valid JSON.";
$output = "502 Bad Gateway\n\nInvalid JSON from $url";
$response->header( %header, -status => 502 );
}
}
else {
$output =
"Request to $url failed: " . $ua_response->status_line();
"500 Internal Server Error\n\nRequest failed $url\n\nError was: '"
. $ua_response->status_line() . "'";
$response->header( %header, -status => 500 );
}
}
else {
$output = "$url not in whitelist";
$output = "403 Forbidden\n\nURL not whitelisted $url";
$response->header( %header, -status => 403 );
}
}
else {
$output = 'Invalid request: missing url';
$output = "400 Bad Request\n\nMissing url parameter";
$response->header( %header, -status => 400 );
}

Expand Down

0 comments on commit 0fb51c9

Please sign in to comment.