*
*/
-#include "config.h"
+#include "squid.h"
+#include "comm/Connection.h"
#include "HttpReply.h"
#include "ipc/Port.h"
#include "mgr/ActionCreator.h"
// Assume most kid classes are fully aggregatable (i.e., they do not dump
// local info at all). Do not import the remote HTTP fd into our Comm
// space; collect and send an IPC msg with collected info to Coordinator.
- ::close(request.fd);
+ ::close(request.conn->fd);
+ request.conn->fd = -1;
collect();
sendResponse(request.requestId);
}
if (writeHttpHeader) {
HttpReply *rep = new HttpReply;
rep->setHeaders(HTTP_OK, NULL, "text/plain", -1, squid_curtime, squid_curtime);
+ // Allow cachemgr and other XHR scripts access to our version string
+ const ActionParams ¶ms = command().params;
+ if (params.httpOrigin.size() > 0) {
+ rep->header.putExt("Access-Control-Allow-Origin", params.httpOrigin.termedBuf());
+#if HAVE_AUTH_MODULE_BASIC
+ rep->header.putExt("Access-Control-Allow-Credentials","true");
+#endif
+ rep->header.putExt("Access-Control-Expose-Headers","Server");
+ }
entry->replaceHttpReply(rep);
}