Setting MaxURLLength of HTTPGet Call in asp.net core
Hi I need to update the maxurllength of asp.net core service that is running on a service fabric cluster using kestral server.
Looking at other solutions people have recomended making changes to registry and web.config but in case of Kestral server running asp.net core on service fabric we dont have any web.config file.
Kestral server limits does not expose a way of doing this either. Is it possible to do so in ASP.net core?
Update:
I was using service fabric reverse proxy to access the service and a sample problematic URL is :
http://localhost:19081/{appname}/{servicename}/test-backend/v1.0/mode/1/context/5e2550ec-539a-4ea0-81b5-f783ce3f7c48/file/60917927-8a7d-4702-93e4-e2a5ea337937/version/2d826211703581a186b3d5d840e78117903189a5/openfile/W3sia2V5IjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3OjJkODI2MjExNzAzNTgxYTE4NmIzZDVkODQwZTc4MTE3OTAzMTg5YTU6MCIsImNvbnRleHRJZCI6IjVlMjU1MGVjLTUzOWEtNGVhMC04MWI1LWY3ODNjZTNmN2M0OCIsImlNb2RlbElkIjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3IiwiY2hhbmdlU2V0SWQiOiIyZDgyNjIxMTcwMzU4MWExODZiM2Q1ZDg0MGU3ODExNzkwMzE4OWE1Iiwib3Blbk1vZGUiOjEsIl9fbmFtZV9fIjoiSU1vZGVsVGlsZVJwY0ludGVyZmFjZV9JTW9kZWxUb2tlbiIsIl9fdW5yZWdpc3RlcmVkX18iOmZhbHNlfSwiMHgyWdpc3RlcmVkX18iOmZhbHNlfSwiMHgy
The last URL segment which is some encoded string is the issue.
c# asp.net-core azure-service-fabric kestrel-http-server
add a comment |
Hi I need to update the maxurllength of asp.net core service that is running on a service fabric cluster using kestral server.
Looking at other solutions people have recomended making changes to registry and web.config but in case of Kestral server running asp.net core on service fabric we dont have any web.config file.
Kestral server limits does not expose a way of doing this either. Is it possible to do so in ASP.net core?
Update:
I was using service fabric reverse proxy to access the service and a sample problematic URL is :
http://localhost:19081/{appname}/{servicename}/test-backend/v1.0/mode/1/context/5e2550ec-539a-4ea0-81b5-f783ce3f7c48/file/60917927-8a7d-4702-93e4-e2a5ea337937/version/2d826211703581a186b3d5d840e78117903189a5/openfile/W3sia2V5IjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3OjJkODI2MjExNzAzNTgxYTE4NmIzZDVkODQwZTc4MTE3OTAzMTg5YTU6MCIsImNvbnRleHRJZCI6IjVlMjU1MGVjLTUzOWEtNGVhMC04MWI1LWY3ODNjZTNmN2M0OCIsImlNb2RlbElkIjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3IiwiY2hhbmdlU2V0SWQiOiIyZDgyNjIxMTcwMzU4MWExODZiM2Q1ZDg0MGU3ODExNzkwMzE4OWE1Iiwib3Blbk1vZGUiOjEsIl9fbmFtZV9fIjoiSU1vZGVsVGlsZVJwY0ludGVyZmFjZV9JTW9kZWxUb2tlbiIsIl9fdW5yZWdpc3RlcmVkX18iOmZhbHNlfSwiMHgyWdpc3RlcmVkX18iOmZhbHNlfSwiMHgy
The last URL segment which is some encoded string is the issue.
c# asp.net-core azure-service-fabric kestrel-http-server
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54
add a comment |
Hi I need to update the maxurllength of asp.net core service that is running on a service fabric cluster using kestral server.
Looking at other solutions people have recomended making changes to registry and web.config but in case of Kestral server running asp.net core on service fabric we dont have any web.config file.
Kestral server limits does not expose a way of doing this either. Is it possible to do so in ASP.net core?
Update:
I was using service fabric reverse proxy to access the service and a sample problematic URL is :
http://localhost:19081/{appname}/{servicename}/test-backend/v1.0/mode/1/context/5e2550ec-539a-4ea0-81b5-f783ce3f7c48/file/60917927-8a7d-4702-93e4-e2a5ea337937/version/2d826211703581a186b3d5d840e78117903189a5/openfile/W3sia2V5IjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3OjJkODI2MjExNzAzNTgxYTE4NmIzZDVkODQwZTc4MTE3OTAzMTg5YTU6MCIsImNvbnRleHRJZCI6IjVlMjU1MGVjLTUzOWEtNGVhMC04MWI1LWY3ODNjZTNmN2M0OCIsImlNb2RlbElkIjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3IiwiY2hhbmdlU2V0SWQiOiIyZDgyNjIxMTcwMzU4MWExODZiM2Q1ZDg0MGU3ODExNzkwMzE4OWE1Iiwib3Blbk1vZGUiOjEsIl9fbmFtZV9fIjoiSU1vZGVsVGlsZVJwY0ludGVyZmFjZV9JTW9kZWxUb2tlbiIsIl9fdW5yZWdpc3RlcmVkX18iOmZhbHNlfSwiMHgyWdpc3RlcmVkX18iOmZhbHNlfSwiMHgy
The last URL segment which is some encoded string is the issue.
c# asp.net-core azure-service-fabric kestrel-http-server
Hi I need to update the maxurllength of asp.net core service that is running on a service fabric cluster using kestral server.
Looking at other solutions people have recomended making changes to registry and web.config but in case of Kestral server running asp.net core on service fabric we dont have any web.config file.
Kestral server limits does not expose a way of doing this either. Is it possible to do so in ASP.net core?
Update:
I was using service fabric reverse proxy to access the service and a sample problematic URL is :
http://localhost:19081/{appname}/{servicename}/test-backend/v1.0/mode/1/context/5e2550ec-539a-4ea0-81b5-f783ce3f7c48/file/60917927-8a7d-4702-93e4-e2a5ea337937/version/2d826211703581a186b3d5d840e78117903189a5/openfile/W3sia2V5IjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3OjJkODI2MjExNzAzNTgxYTE4NmIzZDVkODQwZTc4MTE3OTAzMTg5YTU6MCIsImNvbnRleHRJZCI6IjVlMjU1MGVjLTUzOWEtNGVhMC04MWI1LWY3ODNjZTNmN2M0OCIsImlNb2RlbElkIjoiNjA5MTc5MjctOGE3ZC00NzAyLTkzZTQtZTJhNWVhMzM3OTM3IiwiY2hhbmdlU2V0SWQiOiIyZDgyNjIxMTcwMzU4MWExODZiM2Q1ZDg0MGU3ODExNzkwMzE4OWE1Iiwib3Blbk1vZGUiOjEsIl9fbmFtZV9fIjoiSU1vZGVsVGlsZVJwY0ludGVyZmFjZV9JTW9kZWxUb2tlbiIsIl9fdW5yZWdpc3RlcmVkX18iOmZhbHNlfSwiMHgyWdpc3RlcmVkX18iOmZhbHNlfSwiMHgy
The last URL segment which is some encoded string is the issue.
c# asp.net-core azure-service-fabric kestrel-http-server
c# asp.net-core azure-service-fabric kestrel-http-server
edited Nov 15 '18 at 4:51
Kayani
asked Nov 13 '18 at 12:07
KayaniKayani
627516
627516
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54
add a comment |
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54
add a comment |
1 Answer
1
active
oldest
votes
For ASP.NET Core 1.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
For ASP.NET Core 2.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
The default on both is 8Kb, so that should be much bigger than the default 2083 Url length provided by chrome and other browsers.
If you are exposing your APIs using the Service Fabric Reverse Proxy, the problem should be the Reverse Proxy and not Kestrel.
Service Fabric Reverse Proxy uses the windows HTTP.sys driver to expose the http endpoints, by default this is limited to 260 chars per segment (values between each slash '/'), if this is the case, you should configure your machine with other values instead, in this case, you should set the value for UrlSegmentMaxLength
To do that you have to create a DWORD called UrlSegmentMaxLength
under the following registry key:
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
and set it to a number between 0 and 32,766.
I think if you provide the real problem, we could help with a better solution.
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280723%2fsetting-maxurllength-of-httpget-call-in-asp-net-core%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For ASP.NET Core 1.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
For ASP.NET Core 2.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
The default on both is 8Kb, so that should be much bigger than the default 2083 Url length provided by chrome and other browsers.
If you are exposing your APIs using the Service Fabric Reverse Proxy, the problem should be the Reverse Proxy and not Kestrel.
Service Fabric Reverse Proxy uses the windows HTTP.sys driver to expose the http endpoints, by default this is limited to 260 chars per segment (values between each slash '/'), if this is the case, you should configure your machine with other values instead, in this case, you should set the value for UrlSegmentMaxLength
To do that you have to create a DWORD called UrlSegmentMaxLength
under the following registry key:
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
and set it to a number between 0 and 32,766.
I think if you provide the real problem, we could help with a better solution.
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
add a comment |
For ASP.NET Core 1.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
For ASP.NET Core 2.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
The default on both is 8Kb, so that should be much bigger than the default 2083 Url length provided by chrome and other browsers.
If you are exposing your APIs using the Service Fabric Reverse Proxy, the problem should be the Reverse Proxy and not Kestrel.
Service Fabric Reverse Proxy uses the windows HTTP.sys driver to expose the http endpoints, by default this is limited to 260 chars per segment (values between each slash '/'), if this is the case, you should configure your machine with other values instead, in this case, you should set the value for UrlSegmentMaxLength
To do that you have to create a DWORD called UrlSegmentMaxLength
under the following registry key:
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
and set it to a number between 0 and 32,766.
I think if you provide the real problem, we could help with a better solution.
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
add a comment |
For ASP.NET Core 1.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
For ASP.NET Core 2.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
The default on both is 8Kb, so that should be much bigger than the default 2083 Url length provided by chrome and other browsers.
If you are exposing your APIs using the Service Fabric Reverse Proxy, the problem should be the Reverse Proxy and not Kestrel.
Service Fabric Reverse Proxy uses the windows HTTP.sys driver to expose the http endpoints, by default this is limited to 260 chars per segment (values between each slash '/'), if this is the case, you should configure your machine with other values instead, in this case, you should set the value for UrlSegmentMaxLength
To do that you have to create a DWORD called UrlSegmentMaxLength
under the following registry key:
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
and set it to a number between 0 and 32,766.
I think if you provide the real problem, we could help with a better solution.
For ASP.NET Core 1.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
For ASP.NET Core 2.1 KestrelServerLimits.MaxRequestLineSize
should be what you are looking for.
The default on both is 8Kb, so that should be much bigger than the default 2083 Url length provided by chrome and other browsers.
If you are exposing your APIs using the Service Fabric Reverse Proxy, the problem should be the Reverse Proxy and not Kestrel.
Service Fabric Reverse Proxy uses the windows HTTP.sys driver to expose the http endpoints, by default this is limited to 260 chars per segment (values between each slash '/'), if this is the case, you should configure your machine with other values instead, in this case, you should set the value for UrlSegmentMaxLength
To do that you have to create a DWORD called UrlSegmentMaxLength
under the following registry key:
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
and set it to a number between 0 and 32,766.
I think if you provide the real problem, we could help with a better solution.
answered Nov 13 '18 at 14:20
Diego MendesDiego Mendes
4,32211826
4,32211826
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
add a comment |
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
Great catch. I was using service fabric reverse proxy and thats where its breaking. So the kestrel server is not limiting me the reverse proxy is because one of the URL segment exceed max limit of 260. I'll give a try to changing the registry and let you know if it works. Cheers :)
– Kayani
Nov 15 '18 at 4:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280723%2fsetting-maxurllength-of-httpget-call-in-asp-net-core%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What do you want to set it to?
– mjwills
Nov 13 '18 at 12:44
a value like 1096 maybe
– Kayani
Nov 13 '18 at 13:54