Setting MaxURLLength of HTTPGet Call in asp.net core












0















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.










share|improve this question

























  • 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
















0















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.










share|improve this question

























  • 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














0












0








0








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer
























  • 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











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
});


}
});














draft saved

draft discarded


















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









1














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.






share|improve this answer
























  • 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
















1














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.






share|improve this answer
























  • 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














1












1








1







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python