124 |
|
|
125 |
BlockId id = new BlockId(uri); |
BlockId id = new BlockId(uri); |
126 |
Block block = pool.get(id); |
Block block = pool.get(id); |
127 |
if(HTTPProxy.dbg) p("<"+port+"> Serve: "+id); |
|
128 |
HTTPResponse resp = resf.makeResponse(200, "Ok"); |
HTTPResponse resp = resf.makeResponse(200, "Ok"); |
129 |
resp.setField("Content-Type", id.getContentType()); |
resp.setField("Content-Type", id.getContentType()); |
130 |
if((!rewrite && !backlinks) || |
if((!rewrite && !backlinks) || |
131 |
!id.getContentType().equals("text/html")) { |
!id.getContentType().equals("text/html")) { |
132 |
CopyUtil.copy(block.getInputStream(), |
int blocksize = CopyUtil.copy(block.getInputStream(), |
133 |
resp.getOutputStream()); |
resp.getOutputStream()); |
134 |
|
if(HTTPProxy.dbg) p("<"+port+"> Serve: "+id + " (Size: " + |
135 |
|
String.valueOf(blocksize) + ")"); |
136 |
} else { |
} else { |
137 |
if(HTTPProxy.dbg) p("Start rewrite"); |
if(HTTPProxy.dbg) p("Start rewrite"); |
138 |
|
|