Bug 1414981 - Request URL should not show #hash;r=Honza

MozReview-Commit-ID: G3FqltGcaTC

--HG--
extra : rebase_source : 1f7ef8c660c0116f8ead6b0af538301d3131765d
This commit is contained in:
Fred Lin 2017-11-07 13:46:57 +08:00
Родитель c9b01d9a02
Коммит bab01c9041
3 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -170,8 +170,9 @@ class HeadersPanel extends Component {
this.getProperties(uploadHeaders, REQUEST_HEADERS_FROM_UPLOAD),
);
// not showing #hash in url
let summaryUrl = urlDetails.unicodeUrl ?
this.renderSummary(SUMMARY_URL, new URL(urlDetails.unicodeUrl).origin) : null;
this.renderSummary(SUMMARY_URL, urlDetails.unicodeUrl.split("#")[0]) : null;
let summaryMethod = method ?
this.renderSummary(SUMMARY_METHOD, method) : null;

Просмотреть файл

@ -30,6 +30,7 @@ add_task(function* () {
// request #0
method: "GET",
uri: STATUS_CODES_SJS + "?sts=100",
correctUri: STATUS_CODES_SJS + "?sts=100",
details: {
status: 101,
statusText: "Switching Protocols",
@ -42,7 +43,8 @@ add_task(function* () {
{
// request #1
method: "GET",
uri: STATUS_CODES_SJS + "?sts=200",
uri: STATUS_CODES_SJS + "?sts=200#doh",
correctUri: STATUS_CODES_SJS + "?sts=200",
details: {
status: 202,
statusText: "Created",
@ -56,6 +58,7 @@ add_task(function* () {
// request #2
method: "GET",
uri: STATUS_CODES_SJS + "?sts=300",
correctUri: STATUS_CODES_SJS + "?sts=300",
details: {
status: 303,
statusText: "See Other",
@ -69,6 +72,7 @@ add_task(function* () {
// request #3
method: "GET",
uri: STATUS_CODES_SJS + "?sts=400",
correctUri: STATUS_CODES_SJS + "?sts=400",
details: {
status: 404,
statusText: "Not Found",
@ -82,6 +86,7 @@ add_task(function* () {
// request #4
method: "GET",
uri: STATUS_CODES_SJS + "?sts=500",
correctUri: STATUS_CODES_SJS + "?sts=500",
details: {
status: 501,
statusText: "Not Implemented",
@ -169,9 +174,9 @@ add_task(function* () {
let panel = document.querySelector("#headers-panel");
let summaryValues = panel.querySelectorAll(".tabpanel-summary-value.textbox-input");
let { method, uri, details: { status, statusText } } = data;
let { method, correctUri, details: { status, statusText } } = data;
is(summaryValues[0].value, new URL(uri).origin,
is(summaryValues[0].value, correctUri,
"The url summary value is incorrect.");
is(summaryValues[1].value, method, "The method summary value is incorrect.");
is(panel.querySelector(".requests-list-status-icon").dataset.code, status,
@ -190,7 +195,8 @@ add_task(function* () {
document.querySelector("#params-tab"));
let panel = document.querySelector("#params-panel");
let statusParamValue = data.uri.split("=").pop();
// Bug 1414981 - Request URL should not show #hash
let statusParamValue = data.uri.split("=").pop().split("#")[0];
let treeSections = panel.querySelectorAll(".tree-section");
is(treeSections.length, 1,

Просмотреть файл

@ -402,7 +402,8 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
transferred, size, time, displayedStatus } = data;
let target = document.querySelectorAll(".request-list-item")[visibleIndex];
let unicodeUrl = decodeUnicodeUrl(url);
// Bug 1414981 - Request URL should not show #hash
let unicodeUrl = decodeUnicodeUrl(url).split("#")[0];
let name = getUrlBaseName(url);
let query = getUrlQuery(url);
let host = getUrlHost(url);
@ -424,7 +425,7 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
ok(requestItem.url.startsWith(url), "The attached url is correct.");
} else {
is(requestItem.method, method, "The attached method is correct.");
is(requestItem.url, url, "The attached url is correct.");
is(requestItem.url, url.split("#")[0], "The attached url is correct.");
}
is(target.querySelector(".requests-list-method").textContent,