File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -722,11 +722,12 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
722
722
filename_js->IsString ()) {
723
723
node::Utf8Value filename (node_env->isolate (), filename_js);
724
724
725
- // Turn the absolute path into a URL. Currently the absolute path is always
726
- // a file system path.
727
- // TODO(gabrielschulhof): Pass the `filename` through unchanged if/when we
728
- // receive it as a URL already.
729
- module_filename = node::url::FromFilePath (filename.ToStringView ());
725
+ const auto filename_view = filename.ToStringView ();
726
+ if (filename_view.find (" ://" ) != std::string_view::npos) {
727
+ module_filename = filename_view;
728
+ } else {
729
+ module_filename = node::url::FromFilePath (filename_view);
730
+ }
730
731
}
731
732
732
733
// Create a new napi_env for this specific module.
You can’t perform that action at this time.
0 commit comments