Skip to content
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
11 changes: 0 additions & 11 deletions pkgs/google_cloud_storage/lib/src/file_upload.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import 'dart:typed_data';
import 'package:crypto/crypto.dart' as crypto;
import 'package:google_cloud_rpc/exceptions.dart';
import 'package:http/http.dart' as http;
import 'package:meta/meta.dart';

import 'crc32c.dart';
import 'object_metadata.dart';
Expand All @@ -33,17 +32,7 @@ final _random = Random.secure();
/// See https://datatracker.ietf.org/doc/html/rfc2046
const _boundaryChars = 'abcdefghijklmnopqrstuvwxyz0123456789';

/// The boundary string to use when seperating parts of a multipart request.
///
/// If `null` then the boundary string will be generated randomly. Setting this
/// to a fixed value is useful for testing because it results in a deterministic
/// request body.
@visibleForTesting
String? fixedBoundaryString;

String _boundaryString() {
if (fixedBoundaryString case final boundary?) return boundary;

// A boundary string has a maximum length of 70 characters.
// See https://datatracker.ietf.org/doc/html/rfc2046#section-5.1
var prefix = 'http-boundary-';
Expand Down
2 changes: 0 additions & 2 deletions pkgs/google_cloud_storage/test/delete_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import 'dart:convert';

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart';
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:test/test.dart';
Expand All @@ -28,7 +27,6 @@ void main() async {
group('delete object', () {
group('google-cloud', tags: ['google-cloud'], () {
setUp(() {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
3 changes: 0 additions & 3 deletions pkgs/google_cloud_storage/test/download_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import 'dart:io';
import 'dart:typed_data';

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart'
show fixedBoundaryString;
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:test/test.dart';
Expand All @@ -34,7 +32,6 @@ void main() async {
group('download object', () {
group('google-cloud', tags: ['google-cloud'], () {
setUp(() async {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
2 changes: 0 additions & 2 deletions pkgs/google_cloud_storage/test/list_objects_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ library;
import 'dart:convert';

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart';
import 'package:test/test.dart';

import 'test_utils.dart';
Expand All @@ -29,7 +28,6 @@ void main() async {

group('list objects', () {
setUp(() {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
2 changes: 0 additions & 2 deletions pkgs/google_cloud_storage/test/object_metadata_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart';
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:test/test.dart';
Expand All @@ -26,7 +25,6 @@ void main() async {
group('object metadata', () {
group('google-cloud', tags: ['google-cloud'], () {
setUp(() async {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
2 changes: 0 additions & 2 deletions pkgs/google_cloud_storage/test/patch_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'dart:convert';

import 'package:google_cloud_protobuf/protobuf.dart' hide Duration;
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart';
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:test/test.dart';
Expand All @@ -29,7 +28,6 @@ void main() async {
group('patch object', () {
group('google-cloud', tags: ['google-cloud'], () {
setUp(() async {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
3 changes: 0 additions & 3 deletions pkgs/google_cloud_storage/test/storage_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ library;
import 'dart:convert';

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart'
show fixedBoundaryString;
import 'package:test/test.dart';

import 'test_utils.dart';
Expand All @@ -30,7 +28,6 @@ void main() async {

group('storage object', () {
setUp(() {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ library;
import 'dart:convert';

import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart'
show fixedBoundaryString;
import 'package:test/test.dart';

import 'test_utils.dart';
Expand All @@ -30,7 +28,6 @@ void main() async {

group('upload object from string', () {
setUp(() {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
3 changes: 0 additions & 3 deletions pkgs/google_cloud_storage/test/upload_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import 'dart:convert';

import 'package:google_cloud_protobuf/protobuf.dart' as protobuf;
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:google_cloud_storage/src/file_upload.dart'
show fixedBoundaryString;
import 'package:http/http.dart' as http;
import 'package:http/testing.dart';
import 'package:test/test.dart';
Expand All @@ -30,7 +28,6 @@ void main() async {
group('upload object', () {
group('google-cloud', tags: ['google-cloud'], () {
setUp(() {
fixedBoundaryString = 'boundary';
storage = Storage();
});

Expand Down
Loading