Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6232 Fix support ticket referer field #4989

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/feedback_reporters/support_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def custom_zoho_fields
"cf_rollout" => rollout.presence || "Unknown",
"cf_user_agent" => user_agent.presence || "Unknown user agent",
"cf_ip" => ip_address.presence || "Unknown IP",
"cf_referer" => truncated_referer,
"cf_url" => truncated_referer,
"cf_site_skin" => site_skin&.public ? site_skin.title : "Custom skin"
}
end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/feedback_reporters/support_reporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"cf_rollout" => "rollout_value",
"cf_user_agent" => "HTTParty",
"cf_ip" => "127.0.0.1",
"cf_referer" => "https://example.com/works/1",
"cf_url" => "https://example.com/works/1",
"cf_site_skin" => "Reversi"
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@
end

it "returns a hash containing a blank string for referer" do
expect(subject.report_attributes.dig("cf", "cf_referer")).to eq("Unknown URL")
expect(subject.report_attributes.dig("cf", "cf_url")).to eq("Unknown URL")
end
end

Expand All @@ -130,7 +130,7 @@
end

it "truncates the referer to 255 characters" do
expect(subject.report_attributes.dig("cf", "cf_referer").length).to eq(255)
expect(subject.report_attributes.dig("cf", "cf_url").length).to eq(255)
end
end

Expand Down
Loading