Uploaded image for project: 'Minecraft Realms'
  1. Minecraft Realms
  2. REALMS-12172

Realms world upload uses HTTP instead of HTTPS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.1 (Java)
    • Confirmed
    • Java
    • Platform

      The bug

      When uploading a Realms world HTTP instead of HTTPS (i.e. unencrypted) is used:
      com.mojang.realmsclient.client.FileUpload.requestUpload(int) (Mojang name)

      Code Analysis

         private UploadResult requestUpload(int i) {
            UploadResult.Builder uploadRequestBuilder = new UploadResult.Builder();
            if (this.cancelled.get()) {
               return uploadRequestBuilder.build();
            } else {
               this.uploadStatus.totalBytes = this.file.length();
               HttpPost httpPost = new HttpPost(this.uploadInfo.getUploadEndpoint().resolve("/upload/" + this.realmId + "/" + this.slotId));
               CloseableHttpClient closeableHttpClient = HttpClientBuilder.create().setDefaultRequestConfig(this.requestConfig).build();
               try {
                  this.setupRequest(httpPost);
                  CloseableHttpResponse closeableHttpResponse = closeableHttpClient.execute(httpPost);
                  long var6 = this.getRetryDelaySeconds(closeableHttpResponse);
                  if (this.shouldRetry(var6, i)) {
                     UploadResult uploadResult = this.retryUploadAfter(var6, i);
                     return uploadResult;
                  }
                  this.handleResponse(closeableHttpResponse, uploadRequestBuilder);
               } catch (Exception exception) {
                  if (!this.cancelled.get()) {
                     LOGGER.error("Caught exception while uploading: ", exception);
                  }
               } finally {
                  this.cleanup(httpPost, closeableHttpClient);
               }
               return uploadRequestBuilder.build();
            }
      

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: