Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2aa90166
Unverified
Commit
2aa90166
authored
Apr 27, 2020
by
Jonah Williams
Committed by
GitHub
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure etag headers are ascii (#55704)
parent
34b8f830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
devfs_web.dart
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
+2
-1
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+12
-0
No files found.
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
2aa90166
...
...
@@ -350,7 +350,8 @@ class WebAssetServer implements AssetReader {
// For real files, use a serialized file stat plus path as a revision.
// This allows us to update between canvaskit and non-canvaskit SDKs.
final
String
etag
=
file
.
lastModifiedSync
().
toIso8601String
()
+
file
.
path
;
final
String
etag
=
file
.
lastModifiedSync
().
toIso8601String
()
+
Uri
.
encodeComponent
(
file
.
path
);
if
(
ifNoneMatch
==
etag
)
{
return
shelf
.
Response
.
notModified
();
}
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
2aa90166
...
...
@@ -324,6 +324,18 @@ void main() {
expect
((
await
response
.
read
().
toList
()).
first
,
source
.
readAsBytesSync
());
}));
test
(
'serves valid etag header for asset files with non-ascii chracters'
,
()
=>
testbed
.
run
(()
async
{
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'flutter_assets'
,
'fooπ'
))
..
createSync
(
recursive:
true
)
..
writeAsBytesSync
(<
int
>[
1
,
2
,
3
]);
final
Response
response
=
await
webAssetServer
.
handleRequest
(
Request
(
'GET'
,
Uri
.
parse
(
'http://foobar/assets/fooπ'
)));
final
String
etag
=
response
.
headers
[
HttpHeaders
.
etagHeader
];
expect
(
etag
.
runes
,
everyElement
(
predicate
((
int
char
)
=>
char
<
255
)));
}));
test
(
'handles serving missing asset file'
,
()
=>
testbed
.
run
(()
async
{
final
Response
response
=
await
webAssetServer
.
handleRequest
(
Request
(
'GET'
,
Uri
.
parse
(
'http://foobar/assets/foo'
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment