validate resource/locks on POST, then pass to the default handler */
| 958 | |
| 959 | /* validate resource/locks on POST, then pass to the default handler */ |
| 960 | static int dav_method_post(request_rec *r) |
| 961 | { |
| 962 | dav_resource *resource; |
| 963 | dav_error *err; |
| 964 | |
| 965 | /* Ask repository module to resolve the resource */ |
| 966 | err = dav_get_resource(r, 0 /* label_allowed */, 0 /* use_checked_in */, |
| 967 | &resource); |
| 968 | if (err != NULL) |
| 969 | return dav_handle_err(r, err, NULL); |
| 970 | |
| 971 | /* check for any method preconditions */ |
| 972 | if (dav_run_method_precondition(r, resource, NULL, NULL, &err) != DECLINED |
| 973 | && err) { |
| 974 | return dav_handle_err(r, err, NULL); |
| 975 | } |
| 976 | |
| 977 | /* Note: depth == 0. Implies no need for a multistatus response. */ |
| 978 | if ((err = dav_validate_request(r, resource, 0, NULL, NULL, |
| 979 | DAV_VALIDATE_RESOURCE, NULL)) != NULL) { |
| 980 | /* ### add a higher-level description? */ |
| 981 | return dav_handle_err(r, err, NULL); |
| 982 | } |
| 983 | |
| 984 | return DECLINED; |
| 985 | } |
| 986 | |
| 987 | /* handle the PUT method */ |
| 988 | static int dav_method_put(request_rec *r) |
no test coverage detected