Skip to content
Snippets Groups Projects
Commit fe86066e authored by lcappelli's avatar lcappelli
Browse files

Rmove the patch file from the .devcontainer folder

The patch file used by the .devcontainer is needed only by  the build-install-ngx-voms.sh script. This script could use the patch file in the project home dir instead of the copy in the container.

Add an echo in the container specifing that the patch file must exists in the directory where the user runs the script.

Add  a check in the script: if the patch file isn't found, the script adivses the user and exits with an error.
parent 9ad4efe3
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,6 @@ RUN yum update -y && \
sh /docker/provide-user.sh ${DEV_USER} ${DEV_USER_UID} ${DEV_GID} && \
yum clean all && rm -rf /var/cache/yum
COPY --chown=$DEV_USER:$DEV_USER assets/nginx-httpg_no_delegation.patch /home/$DEV_USER/
COPY --chown=$DEV_USER:$DEV_USER assets/build-install-ngx-voms.sh /home/$DEV_USER/bin/
USER $DEV_USER
......
......@@ -102,6 +102,11 @@ if [ ! -d "${module_root}" ]; then
exit 1
fi
if [ ! -f "./nginx-httpg_no_delegation.patch" ]; then
>&2 echo 'nginx-httpg_no_delegation.patch not found in current dir.'
exit 1
fi
RESTY_PACKAGES_PREFIX=/usr/local/openresty
ZLIB_PREFIX=/usr
OPENSSL_PREFIX=/usr
......@@ -121,7 +126,7 @@ cd ${openresty_root}
nginx_version=$(find build -name nginx.h | xargs awk '/define NGINX_VERSION/ {print $3}' | tr -d '"')
cd build/nginx-${nginx_version}
patch -p1 < ${HOME}/nginx-httpg_no_delegation.patch
patch -p1 < nginx-httpg_no_delegation.patch
cd -
make -j $(nproc)
......
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index d9a1dbed..7438816e 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -149,7 +149,13 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
break;
}
- if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
+ if (ch == '0') {
+ // httpg with no delegation
+ // eat the character and continue with the rest of the request
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "httpg request w/o delegation");
+ r->request_start++;
+ // httpg with a delegation request would fail for an unknown method
+ } else if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
return NGX_HTTP_PARSE_INVALID_METHOD;
}
......@@ -17,6 +17,7 @@ fi
if [ -n "\${PS1}" ]; then
echo
echo "To build and install openresty with the ngx_http_voms_module run 'build-install-ngx-voms.sh'"
echo "'nginx-httpg_no_delegation.patch' is needed in the directory where the user runs the script"
echo
fi
EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment