Should package.json be blocked by web server (IIS)
If I try to access web.config
server returns HTTP Error 404.8 - Not Found
(The request filtering module is configured to deny a path in the URL that contains a hiddenSegment section.)
If I try to access packages.config
server returns HTTP Error 404.7 - Not Found
(The request filtering module is configured to deny the file extension.)
Now I get why those two are blocked/filtered. But I am not sure why package.json is not.
.json
files that do need be served by the Web Server (IIS)? Just add it to web.config's hiddenSegments section:
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="package.json" />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
More details about hiddenSegments available here
链接地址: http://www.djcxy.com/p/42070.html