Permalink
Browse files

WL-1709 Make sure we don't include bad URLs.

  • Loading branch information...
1 parent fbf3521 commit e4c6f221fa9cd94b4e4c6ed14892ae14d0944670 @buckett buckett committed Aug 15, 2011
@@ -124,7 +124,10 @@ public JSONObject toJSON() throws JSONException {
JSONObject json = new JSONObject();
json.put("id", id);
- json.put("href", href);
+ // We started getting bad URLs back and this prevents us from outputting bad linkes.
+ if (href != null && href.startsWith("http")) {
+ json.put("href", href);
+ }
JSONArray itemList = new JSONArray();
for (Item item: items) {
@@ -101,7 +101,9 @@ public JSONObject toJSON() throws JSONException {
if (null != id) {
json.put("id", id);
}
- if (null != href) {
+ // The library system was returning OVP for the URL, which is presented as a relative URL
+ // and doesn't work. So only output if it looks sensible.
+ if (null != href && href.startsWith("http")) {
json.put("href", href);
}
for (Message message : messages) {

0 comments on commit e4c6f22

Please sign in to comment.