return type ? type : "";
}
long getContentLength() const {
- return m_gotBody ? m_body.length() : m_req->remaining;
+ // Apache won't expose content length until the body's read.
+ if (!m_gotBody) {
+ getRequestBody();
+ }
+ return m_body.length();
}
string getRemoteAddr() const {
string ret = AbstractSPRequest::getRemoteAddr();
#else
shib_request_config* rc = (shib_request_config*)ap_get_module_config(r->request_config, &mod_shib);
if (!rc || !rc->sta) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker found no per-request structure");
- return SERVER_ERROR;
+ ap_log_rerror(APLOG_MARK, APLOG_INFO|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker found no per-request structure");
+ shib_post_read(r); // ensures objects are created if post_read hook didn't run
+ rc = (shib_request_config*)ap_get_module_config(r->request_config, &mod_shib);
}
ShibTargetApache* psta = rc->sta;
#endif
status = true;
}
}
- else if ((!strcmp(w,"valid-user") || !strcmp(w,"shib-session")) && session) {
- request.log(SPRequest::SPDebug, "htaccess: accepting shib-session/valid-user based on active session");
+ else if (!strcmp(w,"valid-user") && session) {
+ request.log(SPRequest::SPDebug, "htaccess: accepting valid-user based on active session");
+ status = true;
+ }
+ else if (sta->m_dc->bCompatWith24 == 1 && !strcmp(w,"shib-session") && session) {
+ request.log(SPRequest::SPDebug, "htaccess: accepting shib-session based on active session");
status = true;
}
else if (!strcmp(w,"user") && !remote_user.empty()) {
status = (doUser(*sta, t) == shib_acl_true);
}
+ else if (sta->m_dc->bCompatWith24 == 1 && !strcmp(w,"shib-user") && !remote_user.empty()) {
+ status = (doUser(*sta, t) == shib_acl_true);
+ }
else if (!strcmp(w,"group") && !remote_user.empty()) {
status = (doGroup(*sta, t) == shib_acl_true);
}