user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: edef <edef@edef.eu>
To: meta@public-inbox.org
Cc: hi@alyssa.is, edef <edef@edef.eu>
Subject: [PATCH 1/1] wwwstream: copy $ctx->{env} in new
Date: Tue, 24 Sep 2019 04:10:53 +0000	[thread overview]
Message-ID: <c83aeae2703ae5501732fd1dc651b76e23211960.1569296942.git-series.edef@edef.eu> (raw)
In-Reply-To: <cover.0f97c47bb88db8b875be7497289d8fedd3b11991.1569296942.git-series.edef@edef.eu>

Plack::App::URLMap wipes out SCRIPT_NAME after we return,
and _html_end needs it for generating correct URLs
---
 lib/PublicInbox/WwwStream.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index e0823c8..6bca095 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -19,6 +19,10 @@ sub close {}
 
 sub new {
 	my ($class, $ctx, $cb) = @_;
+
+	my %env = %{$ctx->{env}}; # full hash copy
+	$ctx->{env} = \%env;
+
 	bless { nr => 0, cb => $cb || *close, ctx => $ctx }, $class;
 }
 
-- 
git-series 0.9.1

  reply	other threads:[~2019-09-24  4:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24  4:10 [PATCH 0/1] Fix broken clone URLs due to SCRIPT_NAME getting reset edef
2019-09-24  4:10 ` edef [this message]
2019-09-26  3:03 ` Eric Wong
2019-10-01  7:13   ` [PATCH] www: fix absolute URLs when mounted under a subdir Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c83aeae2703ae5501732fd1dc651b76e23211960.1569296942.git-series.edef@edef.eu \
    --to=edef@edef.eu \
    --cc=hi@alyssa.is \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).