Skip to content

Commit

Permalink
Remove download_url and delete_url for files
Browse files Browse the repository at this point in the history
The REST API shouldn’t return such URLs.  They are specific for web app
and can be calculated without being returned.

Fixes #22792
  • Loading branch information
vboctor committed Jan 28, 2018
1 parent 43facfa commit 84349ec
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
8 changes: 0 additions & 8 deletions api/rest/restcore/issues_rest.php
Expand Up @@ -526,14 +526,6 @@ function rest_issue_files_get( \Slim\Http\Request $p_request, \Slim\Http\Respons
)
);

if( $t_internal_file['can_download'] ) {
$t_file['download_url'] = $t_internal_file['download_url'];
}

if( $t_internal_file['can_delete'] ) {
$t_file['delete_url'] = $t_internal_file['delete_url'];
}

if( $t_internal_file['exists'] ) {
$t_file['content_type'] = $t_internal_file['content_type'];
$t_file['content'] = base64_encode( $t_internal_file['content'] );
Expand Down
8 changes: 0 additions & 8 deletions api/soap/mc_issue_api.php
Expand Up @@ -512,14 +512,6 @@ function mci_issue_get_attachments( $p_issue_id ) {
'delete' => $t_attachment_row['can_delete']
);

if( $t_attachment_row['can_download'] ) {
$t_attachment['download_url'] = mci_get_mantis_path() . 'file_download.php?file_id=' . $t_attachment_row['id'] . '&type=bug';
}

if( $t_attachment_row['can_delete'] ) {
$t_attachment['delete_url'] = mci_get_mantis_path() . 'bug_file_delete.php?file_id=' . $t_attachment_row['id'];
}

$t_attachment['created_at'] = $t_created_at;
}

Expand Down
3 changes: 0 additions & 3 deletions core/commands/IssueFileGetCommand.php
Expand Up @@ -77,9 +77,6 @@ protected function process() {
$t_result = file_get_content( $t_attachment['id'] );
$t_attachment['content_type'] = $t_result['type'];
$t_attachment['content'] = $t_result['content'];
$t_attachment['download_url'] = $t_mantis_path .
'file_download.php?file_id=' . $t_attachment['id'] . '&type=bug';
$t_attachment['delete_url'] = $t_mantis_path . 'bug_file_delete.php?file_id=' . $t_attachment_row['id'];

$t_matching_attachments[] = $t_attachment;
}
Expand Down

0 comments on commit 84349ec

Please sign in to comment.