Skip to content

Commit

Permalink
rgw: fix opslog can't record referrer when using curl as client
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/20935

Signed-off-by: Jiaying Ren jiaying.ren@umcloud.com
  • Loading branch information
Jiaying Ren committed Aug 7, 2017
1 parent 311bfca commit dda244d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rgw/rgw_log.cc
Expand Up @@ -346,7 +346,11 @@ int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
else
set_param_str(s, "REMOTE_ADDR", entry.remote_addr);
set_param_str(s, "HTTP_USER_AGENT", entry.user_agent);
set_param_str(s, "HTTP_REFERRER", entry.referrer);
// legacy apps are still using misspelling referer, such as curl -e option
if (s->info.env->exists("HTTP_REFERRER"))
set_param_str(s, "HTTP_REFERRER", entry.referrer);
else
set_param_str(s, "HTTP_REFERER", entry.referrer);
set_param_str(s, "REQUEST_URI", entry.uri);
set_param_str(s, "REQUEST_METHOD", entry.op);

Expand Down

0 comments on commit dda244d

Please sign in to comment.