mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Remove 'no cache' directive for POST requests
The response for POST request is only cachable under a specific condition and qbt doesn't use it. https://developer.mozilla.org/en-US/docs/Glossary/Cacheable
This commit is contained in:
@@ -41,8 +41,8 @@ window.qBittorrent.Download = (function() {
|
||||
const getCategories = function() {
|
||||
new Request.JSON({
|
||||
url: 'api/v2/torrents/categories',
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onSuccess: function(data) {
|
||||
if (data) {
|
||||
categories = data;
|
||||
|
||||
@@ -358,8 +358,8 @@ window.qBittorrent.PropFiles = (function() {
|
||||
const url = new URI('api/v2/torrents/files?hash=' + current_hash);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onComplete: function() {
|
||||
clearTimeout(loadTorrentFilesDataTimer);
|
||||
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
|
||||
|
||||
@@ -90,8 +90,8 @@ window.qBittorrent.PropGeneral = (function() {
|
||||
const url = new URI('api/v2/torrents/properties?hash=' + current_id);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onFailure: function() {
|
||||
$('error_div').set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]');
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
@@ -223,8 +223,8 @@ window.qBittorrent.PropGeneral = (function() {
|
||||
const piecesUrl = new URI('api/v2/torrents/pieceStates?hash=' + current_id);
|
||||
new Request.JSON({
|
||||
url: piecesUrl,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onFailure: function() {
|
||||
$('error_div').set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]');
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
|
||||
@@ -64,8 +64,8 @@ window.qBittorrent.PropPeers = (function() {
|
||||
url.setData('hash', current_hash);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onComplete: function() {
|
||||
clearTimeout(loadTorrentPeersTimer);
|
||||
loadTorrentPeersTimer = loadTorrentPeersData.delay(window.qBittorrent.Client.getSyncMainDataInterval());
|
||||
@@ -144,7 +144,6 @@ window.qBittorrent.PropPeers = (function() {
|
||||
if (confirm('QBT_TR(Are you sure you want to permanently ban the selected peers?)QBT_TR[CONTEXT=PeerListWidget]')) {
|
||||
new Request({
|
||||
url: 'api/v2/transfer/banPeers',
|
||||
noCache: true,
|
||||
method: 'post',
|
||||
data: {
|
||||
hash: torrentsTable.getCurrentTorrentID(),
|
||||
|
||||
@@ -64,8 +64,8 @@ window.qBittorrent.PropTrackers = (function() {
|
||||
const url = new URI('api/v2/torrents/trackers?hash=' + current_hash);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onComplete: function() {
|
||||
clearTimeout(loadTrackersDataTimer);
|
||||
loadTrackersDataTimer = loadTrackersData.delay(10000);
|
||||
|
||||
@@ -113,8 +113,8 @@ window.qBittorrent.PropWebseeds = (function() {
|
||||
const url = new URI('api/v2/torrents/webseeds?hash=' + current_hash);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
noCache: true,
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onFailure: function() {
|
||||
$('error_div').set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]');
|
||||
clearTimeout(loadWebSeedsDataTimer);
|
||||
|
||||
@@ -85,7 +85,6 @@ MochaUI.extend({
|
||||
else {
|
||||
new Request.JSON({
|
||||
url: 'api/v2/torrents/uploadLimit',
|
||||
noCache: true,
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: hashes.join('|')
|
||||
@@ -189,7 +188,6 @@ MochaUI.extend({
|
||||
else {
|
||||
new Request.JSON({
|
||||
url: 'api/v2/torrents/downloadLimit',
|
||||
noCache: true,
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: hashes.join('|')
|
||||
|
||||
Reference in New Issue
Block a user