irule to provide win10 registry file
Hi,
as an emergency measure in these difficult times I am using an irule to host a few simple files for remote uses to pick (just some config files for mobile app they usually get when in the office on wifi). I've now been asked to add hosting of a registry file for win10 remote users. The problem I have is that if the content type is "application/octet-stream" then it saves ok, is recognised as a reg file when you run it but it then gives an error:
"Cannot import <location file was saved to>audio.reg: The specified file is not a registry script. You can only import binary files from within the registry editor."
If I change the irule to use content type of "text/plain" it just displays in the browser rather than saving it.
Can anyone suggest how to resolve this? What am I doing wrong?
Sanitised version of the irule is as follows:
when RULE_INIT {
set file1 {
some content
}
set file2 {
some more content
}
set file3 {
even more content
}
set registryfile {
some registry key content
}
}
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/files/file1.txt"
{ HTTP::respond 200 content $::file1 "Content-Type" "text/html" "pragma" "no-cache"}
"/files/file2.txt"
{ HTTP::respond 200 content $::file2 "Content-Type" "text/html" "pragma" "no-cache"}
"/files/file3.txt"
{ HTTP::respond 200 content $::file3 "Content-Type" "text/html" "pragma" "no-cache"}
"/registry/win10reg.reg"
{ HTTP::respond 200 content $::registryfile "Content-Type" "text/plain" "pragma" "no-cache"}
default
{ HTTP::respond 404 content {Page Not Found} "Content-Type" "text/html" "pragma" "no-cache"}
}
}
any help appreciated.
thanks
A